-
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 !!
-
-
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
-
did you know how to UNLOAD now ?
-
?
where is the code?
timer1.interval=0
Unload Me
When i tried it, it worked fine for me.
-
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 ..
-
If I reinstall visual basic , did some bug like the unload who just HIDE will be fixed ??
-
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
-
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....
-
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