Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Billing Statements 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Statement Table
John Gemayel 
    
2 years ago
Is there a tutorial on how to get this code to insert the StatementID into all child fields in the StatementDetailT? (Currently, when I click the button, it only inserts it into to top row)

DetailsPrivate Sub GenerateStatementBtn_Click()
On Error GoTo errorHandling

    If MsgBox("Are you sure?", vbYesNoCancel) <> vbYes Then Exit Sub

    Me.Filter = "CustomerID=" & CustomerID & ""
    Me.FilterOn = True

    
    DoCmd.OpenForm "StatementAddF"
    DoCmd.GoToRecord acDataForm, "StatementAddF", acNewRec
    
    With Forms!StatementAddF
        !StatementDate = Date
        !CustomerID = CustomerID
        !Notes = "Statement as of " & Date
    End With

    DoCmd.GoToControl "StatementAddFSubform"
  
    
    With Forms!StatementAddF!StatementAddFSubform.Form!
    !StatementID = [Forms]![StatementAddF]![StatementID]
  
    End With
      


DoCmd.SetWarnings False

DoCmd.SetWarnings True
Me.Requery

Exit Sub
errorHandling:
MsgBox Err.Description
  
End Sub
John Gemayel OP  @Reply  
    
2 years ago

Alex Hedley  @Reply  
           
2 years ago
John Gemayel OP  @Reply  
    
2 years ago
I tried that but it didn't do anything, I think because StatementAddFSubform opens/loads before StatementAddF. I'll try that again this time while using the above code.  Good idea. Thank You
John Gemayel OP  @Reply  
    
2 years ago
If that doesn't work, I think I'll just add buttons to the subform
Alex Hedley  @Reply  
           
2 years ago
Where does the StatementID live?
John Gemayel OP  @Reply  
    
2 years ago
I use an append query to generate a StatementDetailT from Richard's "orderunpaidcustomerQ"(this tutorial). The StatementID doesn't exist until I click on my "Generate Statement" button to open my "AddStatementF" from my CustomerF. Kind of cheesy but I works nicely.
John Gemayel OP  @Reply  
    
2 years ago
This is coming along nicely, thanks to you guys. I'll let you know if the Default Value works in the StatementAddF subform for the StatementDetailT StatementID
John Gemayel OP  @Reply  
    
2 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Billing Statements 3.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 3:51:52 PM. PLT: 0s