Automatically numbering the report

shamal

Registered User.
Local time
Yesterday, 20:36
Joined
Sep 28, 2013
Messages
86
How can the Name_All report be automatically numbered for each actual print run, not just a preview?Some information from the report is saved after printing in Table1.The error in the example here is that one number appears when previewing, but a different number appears when printing.
 

Attachments

I get this error on Preview
1747833009135.png


Report View
1747833073017.png
 
The error does not appear for me
1747833714704.png
 
The error in the example here is that one number appears when previewing, but a different number appears when printing.
It isn't an error. Preview runs the code once. Print from preview runs the code a second time. If you go direct to print, that might solve the problem.

OR, do the count in the form code each time you run the print rather than in the report itself.

Another option is to open the report in ReportView rather than PrintPreview. Report View doesn't run any code.

I also get an error
1747837458430.png


And finally, you need to add Option Explicit to ALL existing code modules and then change the default setting so that Access will add it automatically for new code modules. Just changing the setting on an existing app does not update existing code modules. You must do that manually.
 

Users who are viewing this thread

Back
Top Bottom