|
-
Sep 27th, 2000, 10:06 PM
#1
Thread Starter
Addicted Member
Unloadable form
I have a form and I wrote:
timer1.interval=0
Unload Me
the form have a timer in whit a interval of 500
The form appear to unload BUT in the timer , I put this code:
msgbox "Hi !"
ok..
if I wrote timer1.interval=0
and unload me,
WHY THE MESSAGE POP UP WHEN THE FORM IS UNLOADED AND THE TIMER STOPPED !?!?!?
( I have nothing in Form_unload )
--> Did you know and other way to unload the form ???
It could be a 50 page API but I must UNLOAD THE FORM
AND STOP THE TIMER !!
-
Sep 27th, 2000, 10:13 PM
#2
Hyperactive Member
"People who think they know everything are a great annoyance to those of us who do."
-
Sep 27th, 2000, 10:14 PM
#3
Use this code to get rid of that msgbox that doesn't go away.
Code:
Private Sub Form_Unload(Cancel As Integer)
Timer1.Interval = 0
Timer1.Enabled = False
Unload Me
Set Form1 = Nothing
End Sub
-
Sep 27th, 2000, 10:15 PM
#4
Thread Starter
Addicted Member
did you know how to UNLOAD now ?
-
Sep 27th, 2000, 10:22 PM
#5
Lively Member
?
where is the code?
timer1.interval=0
Unload Me
When i tried it, it worked fine for me.
-
Sep 27th, 2000, 10:27 PM
#6
Thread Starter
Addicted Member
when the form load,
timer1.interval=5000
in the timer ,
msgbox "Hi!"
timer1.interval=0
timer1.enabled=false
unload me
Set FRM_Access = Nothing ' frm_access is the form name
The form appear to unload BUT
The message appear again and again ( and I dont reload the form )
and in the vb explorer, earch second, the item FRM_Access comme hightlighted and the the form 1 came hightlighted IMMEDIATELY after ..
-
Sep 27th, 2000, 10:54 PM
#7
Thread Starter
Addicted Member
If I reinstall visual basic , did some bug like the unload who just HIDE will be fixed ??
-
Sep 27th, 2000, 11:16 PM
#8
Lively Member
Sorry
Sorry, I don't know what is going on. I tried it with the code just like you said it was and in the same place you said yours was and it appears to work fine for me? Sorry. If you want to post a copy of the files somewhere or email them to me maybe there is something else in the project that you are not seeing that is affecting it. I am really not sure.
Sorry,
KillemAll
-
Sep 28th, 2000, 05:03 AM
#9
Fanatic Member
I believe the timer runs it's own thread. even if you unload the form, the timer is still running.
I tried the second part of code (where Timer1.Enabled = False, etc) and that works for me too.
Actually, the first code snippet worked too. Hmmm....
r0ach™
Don't forget to rate the post
-
Sep 28th, 2000, 05:06 AM
#10
Fanatic Member
Try the code on a new form (Just the code you used here). If you still get that problem, it might be your VB, Else it's something else in FRM_Access
r0ach™
Don't forget to rate the post
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
|