In the mnuExit sub I have 'unload me' which seems to work fine.
But if a user clicks on the (x) on the form, the app stops but still appears in the task list.
Any ideas why this should happen?
Simon
Printable View
In the mnuExit sub I have 'unload me' which seems to work fine.
But if a user clicks on the (x) on the form, the app stops but still appears in the task list.
Any ideas why this should happen?
Simon
Add the folowing code to your form's QueryUnload event. You may not need to consider all the cases.------------------Code:Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Select Case UnloadMode
Case vbFormControlMenu
' The user chose the Close command from the Control menu on the form
' Add code here to do the same things as in your mnuExit, or, preferabbly, have them perform the same Sub
' Case vbFormCode
' ' The Unload statement is invoked from code.
' Case vbAppWindows
' ' The current Microsoft Windows operating environment session
' ' is ending.
' Case vbAppTaskManager
' ' The Microsoft Windows Task Manager is closing the application.
' Case vbFormMDIForm
' ' An MDI child form is closing because the MDI form is closing.
' vbFormOwner
' ' A form is closing because its owner is closing.
Case Else
Cancel = True
End Select
End Sub
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
[This message has been edited by MartinLiss (edited 02-15-2000).]
Heres An Easy Way Of doing this In the QueryExit sub on the forms make it unload all the forms example
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
unload form1
unload form2
End Sub
If any forms arn't unloaded the program is still running
I ran into your situation once before. The following has always worked for me:
WadeCode:Set Form1 = Nothing
Set Form2 = Nothing
... 'all other forms
End