vb to determine if preview or print?

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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top