msgbox

S

smason

Hello

i am new to msgbox and i am trying to ask the user a question
msgbox(Do You Want To print report),vbYesNo

which is fine but then i want to action the print if the answer is "yes"
i.e. print a report but i am now stuck on how to do this!

Any help will be appreciated
 
B

Brendan Reynolds

If MsgBox("Do you want to print report?", vbYesNo) = vbYes Then
'print the report
End If
 
S

smason

Hello

Not still not sinking in! do i have to do a 'if ' YES then print report or
something in the docmd
 
B

Brendan Reynolds

If MsgBox("Do you want to print report?", vbYesNo) = vbYes Then
DoCmd.OpenReport "YourReportNameHere", acViewPreview
End If
 
S

smason

ka ching

Thanks for that!

Brendan Reynolds said:
If MsgBox("Do you want to print report?", vbYesNo) = vbYes Then
DoCmd.OpenReport "YourReportNameHere", acViewPreview
End If
 
Top