Problems with automatically printing report

randypuppy

Registered User.
Local time
Today, 12:21
Joined
Feb 17, 2001
Messages
13
In my database I've set up a report and in one of my forms I've got a button which opens and prints the report (using a macro). Is there a way that a Yes/No message box can be displayed before the report is printed - as this would ensure that the report is not accidently printed.

Thanks for your help
 
Try:
Dim resp as byte
resp = Msgbox("Send direct to printer?",vbYesNoCancel,"Application Title")
'if responded with Yes
If resp = vbYes then
docmd.openreport "Your report",acnormal

'if responded with No
elseif resp = vbNo then
docmd.openreport "Your report",acpreview
end if
'if cancel then do nothing

Should work.

Ian
 

Users who are viewing this thread

Back
Top Bottom