Computer Learning Zone CLZ Access Excel Word Windows

The progress of the world depends almost entirely upon education.

-George Eastman
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to TechHelp    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Print Invoice Totals at Bottom
Edward Mastoloni 
     
4 years ago
I have an invoice print that uses a sub-report for the invoice details.  I created a text box in in the Report Footer section with following control source =[SalesInvoiceLineSubreport].[Report]![TotalAmount].  That works fine but I want it to print at THE bottom of the page along with some text that is contained within Labels (ie standard text about late charges and other legal stuff).

I tried moving all of that to the Page Footer Section and that worked great, however, if the invoice details ran past the end of page 1 to page 2, the Invoice total and labels print at the bottom of both page 1 and 2.  Any ideas how I can get everything (Invoice total and legal mumbo jumbo) on the bottom of the LAST page ONLY
Kevin Yip  @Reply  
     
4 years ago
In your subreport you need to do a VBA trick.  Check if the last record of the subreport has just been printed.  If not, set the main report's footer to blank.  If yes, set the footer's value.  In your subreport's Detail_Format event, write something like this:

     Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
         Parent!footerinfo = IIf(Me!somefield = ValueInLastRecord, "Footer to be printed", "")
     End Sub

"Parent" is an Access keyword that refers to the parent object of the subreport, which is the main report in this case.  "footinfo" is the name of your main report's footer control.

"somefield" is a field on your subreport, could be an ID, invoice#, whatever.  It needs to be something that can help you locate the last record of the subreport.  If you choose "invoice date" as the field, but all records have the same invoice date, then naturally it won't help you.  I suggest you choose a unique index field such as the primary key.  Use the MoveLast command on your subreport's Recordset to check what value it has in the last record.
Edward Mastoloni OP  @Reply  
     
4 years ago
What does "Footer to be printed" mean?
The control name of my report footer is "ReportFooter"
Edward Mastoloni OP  @Reply  
     
4 years ago

Kevin Yip  @Reply  
     
4 years ago
"Footer to be printed" is just a placeholder for whatever you want to print or not want to print in your footer section.  

"ReportFooter" is *not* your footer's control name.  The names of those textboxes in the footer section are.  Let me rewrite my code in the nomenclature you can relate to:


     Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
         Parent!TextboxNameInYourFooter = IIf(Me!somefield = ValueInLastRecord, PutYourSubformTotalHere, "")
     End Sub
Edward Mastoloni OP  @Reply  
     
4 years ago
Got it!  Thanks so much

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

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: 6/16/2026 7:01:02 PM. PLT: 0s