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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This is probably really simple to do.

Status
Not open for further replies.

mrblonde

Technical User
Mar 16, 2001
187
US
I have multiple reports that are printed consecutively
through a macro. In order to keep page numbers in order I have a public function :

Public Function CountPages()
PageNumber = PageNumber + 1
CountPages = PageNumber
End Function

The last command I would like to have the macro execute is setting this back to zero. I'm not sure what macro command to use. Thanks.
 
Place the reset code in the Report(s) On Open event

Private Sub Report_Open(Cancel As Integer)
CountPages = 0
End Sub

PaulF

 
Paul,
Thanks for the response. I tried that with the first report that is run by the macro; It worked well. However when the second report began to run it started at page 37. (it should have been 6) What I think is happening is that the variable is getting reset for the first report but saving the over all value and adding it up.

Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top