Preview/Print Discepancies

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2003 w/ XP
I have a report that has a unbound filed which I assign a number starting at
1.
Dim i as Integer (declared below Option Explicit)
In the OnOpen event I have
i=0

In the Detail.Print Event I have
i=i+1
me.txtOrder= "# " & i

The print preview works fine and so does the print function as long as I
don't preview the report first. If I open the report in Preview mode and
then print, the me.txtOrder starts with number 51 instead of 1.
In what event can I reset this variable to be sure it always starts printing
with 1.

Thanks
 
Guess I jumped too soon. I reset the counter in the ReportFooter_Format
event an d it works fine.
 
BR said:
Guess I jumped too soon. I reset the counter in the ReportFooter_Format
event an d it works fine.


WARNING! That approach does not always work!

Instead of using code in an event procedure to count the
detail records, use a text box in the detail section. Set
its ControlSource to =1 and set its RunningSum property to
Over All.
 
Back
Top