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 strongm 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 ascertaining the # of pages which were just printed a report from VB? In other words
DoCmd.OpenReport "ReportName", acNormal

On the next line I need to know how many pages just printed.

Why you ask? I am doing a mailing and I need to figure out the weight of each package. Each customer has different data printed in their reports and I need to find out the total weight so I can put the proper postage on the envelope. This is all run in a big VB loop. I can do a guestomate by getting the number of records on each report and div. by 50 ignoring page breaks, report breaks, etc.

Thanks,

Remember when... everything worked and there was a reason for it?
 
You could put a message box in the on close event of the report : MsgBox "Reportname page count = " & [Pages]

Beir bua agus beannacht!
 
Hey there. I sort of did what you said. I created a dummy field on a form (which is always open) called txtpages. On the close event of each report, I update it to txtpages + me.pages.
When I am done with all the reports for that customer I have the total pages for that customers. I then mult. by a weight per page. It is working perfectly. Thanks for your help. I just thought I could access this after the opening of the report in vb somehow and get the number of pages which just printed. THere are 10,000 reserve words out there so I gave it a shot, this way I would not have to modify any of the reports.


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

Part and Inventory Search

Sponsor

Back
Top