tell user the number of page of report before print, (1 Viewer)

shaomwang

Registered User.
Local time
Today, 18:15
Joined
Apr 22, 2000
Messages
14
Can you tell me how to tell user the number of page of report before print, using code?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:15
Joined
Feb 19, 2002
Messages
42,971
Please don't post the same question under multiple topics.
 

brian189

Registered User.
Local time
Today, 18:15
Joined
Sep 4, 2000
Messages
10
Try this. Create a text field on your report where the control source is =Pages. You can make this invisible if you don't want it to show up on the report itself.

Then create an Event Procedure for the onPrint Event in the report header that goes something like this:

Dim rptPgs As Integer
rptPgs = Reports!yourReportName.Pages
MsgBox "This report contains " & rptPgs & " pages.
 

brian189

Registered User.
Local time
Today, 18:15
Joined
Sep 4, 2000
Messages
10
Sorry..missed a closing " at the end of the previous post.
 

Users who are viewing this thread

Top Bottom