-
I have a loop in my program to make it pause for a certain amount of time.
Code:
sngTime = Timer
Do While (Timer - sngTime) < 60
DoEvents
Loop
When I exit the program it still appears to be running in the task manager. How do I tell the program to stop all processes when it's closed? Or is there a way for me to check to see if the program has been closed? Then I can exit the Sub.
Thanks
[This message has been edited by desquite (edited 01-28-2000).]
-
One way to end:
Code:
Form_Unload(...)
End
End Sub
Or inside your loop...
Code:
If Me.Visible = False Then End
The second example should only be used if your form is never otherwise hidden.
-
How do you exit the program? When you do exit, do you explicitly unload all forms? If you don't do the latter, it may be the cause of your problem.
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
-
I used to think. Now I'm just scrambled eggs!
-
Here is what my unload sub looks like. It still seems to keep itself in memory though. I'm not sure what part of my program is still looping. Any ideas? Thanks.
Code:
Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
Unload frmMain
Set frmMain = Nothing
End Sub
-
Well, I got it to work. I just added an 'End' after the statements in my Unload sub.
Thanks everyone.