|
-
Jan 28th, 2000, 06:20 AM
#1
Thread Starter
Member
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).]
-
Jan 28th, 2000, 07:06 AM
#2
Hyperactive Member
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.
-
Jan 28th, 2000, 07:34 AM
#3
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.
-
Jan 28th, 2000, 08:42 AM
#4
Hyperactive Member
I used to think. Now I'm just scrambled eggs!
-
Jan 30th, 2000, 10:23 PM
#5
Thread Starter
Member
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
-
Jan 30th, 2000, 11:05 PM
#6
Thread Starter
Member
Well, I got it to work. I just added an 'End' after the statements in my Unload sub.
Thanks everyone.
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
|