Robert12345
MIS
I need to know how to cancel a msgbox if the user chooses "No" in the following code:
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue with the IMPORT?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Import Verification" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
'these next two lines don't work. How do I get
'out of this??????
'DoCmd.Close acForm, "frmMain Menu"
'DoCmd.OpenForm "frmMain Menu"
End If
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue with the IMPORT?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Import Verification" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
'these next two lines don't work. How do I get
'out of this??????
'DoCmd.Close acForm, "frmMain Menu"
'DoCmd.OpenForm "frmMain Menu"
End If