G
Guest
I am trying to force our users to close out of an application correctly. I stumbled upon the Upload event that will handle users trying to exit the program. Below is the code I used
Private Sub Form_Unload(Cancel As Integer
' declare an integer to hold the results of our dialo
Dim intResult As Intege
' tell the user they cannot exit this wa
intResult = MsgBox("Please exit the application correctly", vbOKOnly
If intResult = vbOK The
'force user back to exit correctl
Cancel = Tru
End I
The only problem with this code is that it will display the message even if they exit correctly- Now it will let them exit correctly, but they get the message before they are out.
Is there a way for me to check if the user is exiting correctly, and then disable the message if they do
Thank
jrk
Private Sub Form_Unload(Cancel As Integer
' declare an integer to hold the results of our dialo
Dim intResult As Intege
' tell the user they cannot exit this wa
intResult = MsgBox("Please exit the application correctly", vbOKOnly
If intResult = vbOK The
'force user back to exit correctl
Cancel = Tru
End I
The only problem with this code is that it will display the message even if they exit correctly- Now it will let them exit correctly, but they get the message before they are out.
Is there a way for me to check if the user is exiting correctly, and then disable the message if they do
Thank
jrk