Get the close event of a form [RESOLVED]
Hi
Im trying to put some code,,when a form is close,,but i try with the unload and with the desactivate method,,but it doesnt enter in these methods..but i absolutly need to put code when the window is close,,,is there a way to cath this event. My form is a part of a project thats why its not unload right now
thanks
Mel
Re: Get the close event of a form
The QueryUnload event fires whenever a form is closed, regardless of how it is closed.
You can write code that will do different things depending on how it is closed.
Is this what you mean?
Re: Get the close event of a form
Have a look at the QueryUnload Event it may help you :)
Or, maybe the Terminate Event...
Edit: Sorry Hack I missed your post while I was looking for that link :)
Cheers,
RyanJ
Re: Get the close event of a form
Ok thank you, thats what i need,,,the form_query_unload
it works well
thanks
:thumb: :wave:
Re: Get the close event of a form
Quote:
Originally Posted by DesyM
Ok thank you, thats what i need,,,the form_query_unload
it works well
thanks
:thumb: :wave:
FYI. Here is some info how how you can use "how" the form unloaded.
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'there are 5 unloadmode levels
Select Case UnloadMode
Case vbFormControlMenu 'UnloadMode 0
'form is being unloaded via the Close
'or by hitting the X in the upper right hand corner
'command from the System menu
Case vbFormCode 'UnloadMode 1
'Unload Me has been issued from code
Case vbAppWindows 'UnloadMode 2
'Windows itself is closing
Case vbAppTaskManager 'UnloadMode 3
'the Task Manager is closing the app
Case vbFormMDIForm 'UnloadMod 4
'an MDI child form is closing because
'its parent form is closing
End Select
End Sub
PS: Edit the first post in this thread and add your checkmark there.
Thanks.