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

Printed report is different from preview 2

Status
Not open for further replies.

Locoman

Technical User
Sep 25, 2002
38
GB
Hi folks,
I have a very strange "intermittent" problem with some Access 97 reports, so I'm hoping someone has seen this before.

In my standard report Vba coding I have used the OnFormat and OnPrint events to control things like forced starting page number, conditional page breaks, facing page exceptions etc., and the OnPage event to draw graphic page columns as the final step.

The starting page number is always forced to an odd page; if a particular data group finishes on an odd page I create a different even facing page with parts of the page header blanked out by setting the properties of a masking box to visible.

This always works perfectly in every report in preview. On some report, when the actual report is printed two things can happen: 1) the first page has the parts of the header blanked out, but sucessive pages are formatted OK. 2) When printed, one report type always starts from page 1 regardless of the forced page number. However, if in preview you scroll through some of the pages, then go back to the start before printing, the problem disappears! (It's not printer-dependent)

It seems as though the OnPrint /OnPage setup conditions are not always being recognised at run time.

Any ideas?

Regards,

Brian
 
Does this problem only occur if you print from the preview, or does it occur if you print directly (from your code)? If it doesn't occur when you print directly, rather than previewing first, the conditions may not be the same (as far as Access is concerned) when the printing occurs because the report has already been run for the preview.

I seem to remember that I've seen some differences in preview and printing and they occurred because the report initialization was different.
 
Thanks BSman, that is the solution.
I had not tried printing directly since I assumed that you could go on, from having previewed the report, to then click on "print" without further adoo. If I select print directly from the drop down menu, or place commands in a macro (to print the whole bunch of related reports) the problem does not occur.[thumbsup]

Regards,

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top