|
-
October 18th, 1999, 09:39 AM
#1
unload me
I have a very basic one form program. I am trying to make it exit if a certain condition is true. Right now I am using the following:
If CountDown > 5 then Unload me
CountDown is an Integer variable.
When the statement is true, I keep getting the message, "Run-time error '364': Object was Unloaded"
Is there any problem with using Unload Me in an IF statement?
-
October 18th, 1999, 10:16 AM
#2
Re: unload me
You have a problem somewhere else. You can use this simple code to check that the problem with If and Unload me doesn't exist. Place Timer1 on Form, set its Interval = 1000 (1 sec) and paste this code:
private intCountDown as Integer
private Sub Timer1_Timer()
intCountDown = intCountDown + 1
If intCountDown > 3 then
Unload me
End If
End Sub
Run your project and you'll see it will be unloaded in 3 seconds without any problem.
Vlad
-
October 19th, 1999, 01:46 AM
#3
Re: unload me
If the statement unload me is in your form_load event procedure, move it to the form_activate procedure if you can.
Charlie Zimmerman
http://www.freevbcode.com
-
October 19th, 1999, 07:43 AM
#4
Re: unload me
I kept it in form_load but got rid of a module that was set to the startup form and set my frmMain to the startup. It worked then.
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
|