Kael1
asked on
How do I program the x button?
How do I program the x button in the top right to do whatever I want?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Capture the Event (Unload) on that form, and choose to close it or not, or to do something else.
Try this:
------
Private Sub Form_Unload(Cancel As Integer)
MsgBox ("This will appear when I click the x button !!! ")
if (I_Want_To_Close_This_Wind
'Close all files and handles
Cancel = 0 'This means that this event will get passed on
Else
'Do something else
Cancel = 1 'This means that this event will NOT get passed on
End If
End Sub
-------
Greetings