Msg Box with a cancel option

chuckster

Registered User.
Local time
Today, 14:34
Joined
Oct 4, 2000
Messages
52
I've have a Report that prints from a form button. I've added a MsgBox which warns the user which report it is but it only accepts "OK" and then prints. Could I put a cancel option on the message box so that the action can be cancelled and the report won't print?

Luke
 
Thanks but now how can a use the response to end the event if the cancel button is pressed.
 
Dim StdResponse As Integer

StdResponse = MsgBox("Do you want to print report?", vbOKCancel + vbDefaultButton1)

If StdResponse = vbOK Then ' (Default)
Your Code to print report here
Else 'vbCancel
Exit Sub
End If
 

Users who are viewing this thread

Back
Top Bottom