J
j_gold
Hi,
I have the following in my unload event. I have a button on a form that when
clicked, prompts the user if they want to exit the application (I've disabled
the form's close button so this is the only way to exit the program). If they
click yes, the application should close without further ado, however, the
message asking them to quit appears twice - on the second click of yes, the
application then quits.
The unload event is firing twice. How best to do this?
Thanks, J
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("Exit Application?", vbYesNo) = vbYes Then
DoCmd.Quit
Else
Cancel = True
End If
End Sub
I have the following in my unload event. I have a button on a form that when
clicked, prompts the user if they want to exit the application (I've disabled
the form's close button so this is the only way to exit the program). If they
click yes, the application should close without further ado, however, the
message asking them to quit appears twice - on the second click of yes, the
application then quits.
The unload event is firing twice. How best to do this?
Thanks, J
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("Exit Application?", vbYesNo) = vbYes Then
DoCmd.Quit
Else
Cancel = True
End If
End Sub