hello![]()
Here is my code :
my concern is i want this message box appear everytime i click the X button on the window and its working.but the problem is even i unload my form and open another the msgbox still appear. I know that the logic of the code is when you unload the form this msgbox will appear. i want this msgbox appear when i click the x button only. pls help!Code:Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Cancel = (MsgBox("Are you sure you want to quit? All your unsaved data will be erase.", vbQuestion Or vbYesNo, "Quit?") = vbNo) End Sub
thanks!




Reply With Quote