Computer Learning Zone CLZ Access Excel Word Windows

Tolerance is you saying something crazy and me smiling and saying, "That's nice."

-Penn Jillette
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Access >
TechHelp


Back to TechHelp
 

Print Invoice Totals at Bottom Upload Images   Link  
Edward Mastoloni 
13 days 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
13 days 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
12 days ago
What does "Footer to be printed" mean?
The control name of my report footer is "ReportFooter"
Edward Mastoloni
12 days ago

Kevin Yip
12 days 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
9 days ago
Got it!  Thanks so much
Add a ReplyUpload an Image


Back to TechHelp Comments
 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to TechHelp
Get notifications when this page is updated
 
 
 
 

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
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
amicron@gmail.com
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn