i have a timer but for some reasons, when the app loses focus, the timer doesn work :( is there a way to tell the timer to keep going even when the form is not in focus?
Printable View
i have a timer but for some reasons, when the app loses focus, the timer doesn work :( is there a way to tell the timer to keep going even when the form is not in focus?
actually, the form is .visible = false
That's weird!! Are you sure you're not setting it's enabled property to false in any way?
100% sure
the timer is supposed to call another form after a while, but if i go and start doing stuff (ie: open IE or something else) the form wont appear but if i just sit there and wait, it will
Remember that the default property of the Timer is Enabled, not interval. You might be setting some value to it that could set it to be disabled.
This code works!
VB Code:
Option Explicit Private Sub Form_Load() Me.Visible = False End Sub Private Sub Timer1_Timer() Debug.Print "Hello" End Sub
nop, im not touching the timer at all, the timer loads when the form load and i never ever touch the timer
but what i dont understand is that if i sit there and do nothing it will work but if i openanother window, it wont work
Me neither.... that's so weird.
Can you post the code and/or the code?
//this loads the form the timer is on
frmTimer.hrs = Left(Data, 2)
frmTimer.Min = Mid(Data, 3, 2)
frmTimer.sec = Mid(Data, 5, 2)
Load frmTimer
//this is what the timer does
Private Sub Timer1_Timer()
sec = sec - 1
If sec = 0 Then
If min = 0 Then
If hrs = 0 Then
Load frmMain
frmMain.Show
Unload frmTimer
End If
hrs = hrs - 1
min = 59
sec = 59
End If
min = min - 1
sec = 59
End If
End Sub
//this is the ONLY code contained in frmtimer
nevermind, i fixed my own problem, the form i was loading wasnt set properly....thanx anywayz :)
You're welcome ;)