Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page count

Status
Not open for further replies.

GShen

MIS
Sep 26, 2002
561
US
Is there any way of figuring out how many pages are being printed on a report and capturing that number ? For example, a report is going to print 7 pages. Is there any way in VBA to capture that it is going to or has printed 7 pages? I am printing labels. The only way I can now think of doing this is to run the SP which drives the report using a record set of something and then dividing the number by 24 (# of labels on a page). Just thought there was possibly an easier way of doing this with report property or something. I am using Docmd.OpenReport,"reportname",acnormal to print the report.

Remember when... everything worked and there was a reason for it?
 
When would you want to get the number of pages? If it is before the report has rendered, then there is no way to pull the value from the report. Since these are fixed sized labels, you can find the number of records expected and divide by the number of labels per page.

Duane
Hook'D on Access
MS Access MVP
 
After is fine. That is exactly what I am doing. I am calling the SP and dividing by 24. I need to round up. Isn't there a ceiling function or something?

Remember when... everything worked and there was a reason for it?
 
I ended up doing a mod 24 and checking to see if the remainder was 0. It works. I am moving on. Thanks.

Remember when... everything worked and there was a reason for it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top