page numbers wrong when preview then print

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

Guest

I have inherited a report tha has custom coding in it to handle the page
numbers.
There is a bug there that when a multiple page report got print out after
preview, its page started as Page 2 and Page 3, instead of Page 1 and Page 2.
It looks fine under preview, and it also prints correctly without preview.

I am sure Access treats preview and print as two passes of rendering the
report, and my code did not reset the public counter. However, if I force it
to reset the variable, the page by groups part falls apart.

Before I go to the lenght of replacing current code with James Brooks way, I
want to know is there a way to tell that a rendering is for preview vs for
print?

Thanks!
 
hommer said:
I have inherited a report tha has custom coding in it to handle the page
numbers.
There is a bug there that when a multiple page report got print out after
preview, its page started as Page 2 and Page 3, instead of Page 1 and Page 2.
It looks fine under preview, and it also prints correctly without preview.

I am sure Access treats preview and print as two passes of rendering the
report, and my code did not reset the public counter. However, if I force it
to reset the variable, the page by groups part falls apart.

Before I go to the lenght of replacing current code with James Brooks way, I
want to know is there a way to tell that a rendering is for preview vs for
print?


No, you can not tell why a report is being "rendered"
because each section can be formatted any number of times.
Previewing and printing are just two obvious reasons, but
there are others such as KeepTogether.


You should not have to recode the entire page numbering
mechanism just to properly initialize the Page number.
Generally, setting Me.Page = 1 in the report header
section's Format event is sufficient.
 
Back
Top