Link to home
Create AccountLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How preview report if not already printed

I have this code in the onclick event of a form...

DoCmd.OpenReport "rptLog", acViewPreview, , [Previewed] = 0

Meaning I only want the report to preview if the report has not already been previewed.  But my code must be wrong.  How do I fix it?

Avatar of Daniel Pineault
Daniel Pineault

What about something like:
If Me.Previewed = 0 Then
    DoCmd.OpenReport "rptLog", acViewPreview 
Else
    'What to do if it was already previewed?
End If

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer