|
-
Feb 15th, 2000, 03:48 AM
#1
Thread Starter
Hyperactive Member
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
-
Feb 15th, 2000, 03:55 AM
#2
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).]
-
Feb 15th, 2000, 05:03 AM
#3
Addicted Member
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
-
Feb 15th, 2000, 05:15 AM
#4
Hyperactive Member
I ran into your situation once before. The following has always worked for me:
Code:
Set Form1 = Nothing
Set Form2 = Nothing
... 'all other forms
End
Wade
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|