vb to determine if preview or print?

  • Thread starter Thread starter a
  • Start date Start date
A

a

Hello,

we have some code in detail_format which re-sizes a report. if it is
previewed and then printed it does not work, even though the preview is
fine. How can you tell in vb if the code is being run becuase it is a
preview or a print?

Cheers
 
The code runs for preview, and runs again for print. Perhaps that is the
problem, i.e. you need to use the Format event of the Report Header section
to reset your variables ready the Print-after-Preview run.

To answer your specific question, Access does not tell you whether the view
is Preview or Print, and there is no simple way to determine it. If you open
in Preview, the report's Activate event fires, whereas if you open the
report in Normal view, it does not. In practice that is not very useful,
because if the user opens in Preview and then prints from there, the fact
that Report_Activate already fired gives you no information about the fact
that it is now printing.
 
Back
Top