This form is the logout form, replacing a vbYesNo popup. If they hit logout, it gracefully closes down, or else re- opens the main menu. I am capturing the "X" close, so it says "use the logout button". So basically what's happening now is that no matter if i click logout or X, it always says the X button pushed. Putting the cancel to true, stops the unload though.
Private Sub Form_Unload(Cancel As Integer)
Select Case unloadmode
Case vbFormControlMenu
MsgBox ("X button pushed:" & unloadmode)
Cancel = True
Case Else
MsgBox ("Proper logout button:" & unloadmode)
Cancel = False
End Select
End Sub
Private Sub QuitButton_Click()
Call Form_Unload(1)
End Sub