Get View constant within reports

G

Guest

Is it possible to get the View constant within the Report?
As I know the acView constant is only an argument to Docmd.openreports
I want to insert a timestamp info if the user prints, but not if he uses the
Preview mode.
The code should look like this: (within the report)
sub details_print(...)
if View=acNormal then
set rs=currentdb.openrecordset("select * from Tabelle1 where ID="+Me.id)
rs("timestamp")=now
end if
end sub
I have found a lot of questions in the internet but insufficient answers.

Thanks for your help in advance,
Harry
 
S

SA

Harry:

The challenge of this is when the user might print the report from the
preview mode. The only real way to determine if a report is previewed is to
do so by placing code in the OnActivate event, which only fires if the
report is previewed. However, since a user can print the report from a
preview, then to accurately control only previewing or only printing, you
have to create custom menus and custom tool bars for the report which both
eliminate the print option.

From there, on the form that controls the printing or previewing, you can
then have controls which either preview the report or print the report.
 

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