J
JNariss
Hello,
I have a form which I included and option for users to "Exit Access". I
have put a code behind this to prompt the user that they actually want
to close Access but the code is not working properly. When I choose the
option "no" it closes Access. This is not what I want. I only want
Access to close if "Yes" is chosen.
My code is:
Private Sub cmdExitAccess_Click()
MsgBox "Are you sure you want to close this database?", vbYesNo,
"Confirm Action"
If Msg <> vbYes Then
DoCmd.Quit acQuitSaveAll
Elseif Msg <> vbNo Then
'Do Nothing
End If
End Sub
I have also tried it without including the code for vbNo:
Private Sub cmdExitAccess_Click()
MsgBox "Are you sure you want to close this database?", vbYesNo,
"Confirm Action"
If Msg <> vbYes Then
DoCmd.Quit acQuitSaveAll
End If
End Sub
And this did not work either. Anyone have any ideas on how to fix this
properly??
Thanks,
Justine
I have a form which I included and option for users to "Exit Access". I
have put a code behind this to prompt the user that they actually want
to close Access but the code is not working properly. When I choose the
option "no" it closes Access. This is not what I want. I only want
Access to close if "Yes" is chosen.
My code is:
Private Sub cmdExitAccess_Click()
MsgBox "Are you sure you want to close this database?", vbYesNo,
"Confirm Action"
If Msg <> vbYes Then
DoCmd.Quit acQuitSaveAll
Elseif Msg <> vbNo Then
'Do Nothing
End If
End Sub
I have also tried it without including the code for vbNo:
Private Sub cmdExitAccess_Click()
MsgBox "Are you sure you want to close this database?", vbYesNo,
"Confirm Action"
If Msg <> vbYes Then
DoCmd.Quit acQuitSaveAll
End If
End Sub
And this did not work either. Anyone have any ideas on how to fix this
properly??
Thanks,
Justine