How is it when I close out of my application that it stays running in my processes?
Printable View
How is it when I close out of my application that it stays running in my processes?
Does your app Dim F as form and then F.Show?
When the main app closes, this DIMmed form does not close automatically - it is up to you to close it manually and then set it to nothing.
An easy way of doing this is to place this in the Form_Unload event of the main form of the program:
VB Code:
Dim x As Long '--------------------------------------------------------------------- On Error Resume Next '--------------------------------------------------------------------- For x = Forms.Count - 1 To 0 Step -1 If Not Forms(x) Is Me Then Unload Forms(x) Set Forms(x) = Nothing End If Next On Error GoTo 0
If a user X's out, would that work then too?
Yep - anything that causes the main form to UNLOAD will cause that code to execute. Of course, I am ASSUMING that the "orphaned" form is the cause of your problem, and I may be wrong...
in form unload ..
VB Code:
Do Until Forms.Count = 1 Unload Forms(Forms.Count - 1) Loop Or .. Dim Form For Each Form In Forms Unload (Form) Next Form
in form terminate..
VB Code:
unload me
make sure you stop any timers also ..and close any other objects that maybe open ..