If the user accidentally clicks the X close button I'm using the
following code in the form unload event to stop them from accidentally
quitting Access.
Private Sub Form_Unload(Cancel As Integer)
Select Case MsgBox("Are you sure you want to exit?", vbYesNo)
Case Is = vbYes
Exit Sub
Case Is = vbNo
Cancel = True
End Select
End Sub
However if they use the EXIT button on the form I would like Access to
Quit without stopping the user and asking them if they want to exit
access.
Is it possible to bypass the unload event if the Exit button is clicked?