I am having an interesting problem. When I update the unbound field in a form with the remaining time, it flashes. Is there anyway to eliminate this? (I reduced it by counting by 5's, but I would like to have it countdown without having to do that)
Here is the code:
Private Sub Form_Timer()
Dim start
Dim timer_int
Dim current
Dim elapsed
Dim time_left
dim start
Me.TimerInterval = 0
timer_int = 30
start = Fix(Timer())
timer_loop:
current = Fix(Timer())
elapsed = Fix(current - start)
time_left = timer_int - elapsed
If (time_left / 5) = (Fix(time_left / 5)) Then Me!Text3 = "Application will close in " & time_left & " seconds."
If elapsed >= timer_int Then DoCmd.Quit
GoTo timer_loop
End Sub
(and anyone looking to count by a number, the calculation of x/y = fix(x/y) works nicely. ;-)
Here is the code:
Private Sub Form_Timer()
Dim start
Dim timer_int
Dim current
Dim elapsed
Dim time_left
dim start
Me.TimerInterval = 0
timer_int = 30
start = Fix(Timer())
timer_loop:
current = Fix(Timer())
elapsed = Fix(current - start)
time_left = timer_int - elapsed
If (time_left / 5) = (Fix(time_left / 5)) Then Me!Text3 = "Application will close in " & time_left & " seconds."
If elapsed >= timer_int Then DoCmd.Quit
GoTo timer_loop
End Sub
(and anyone looking to count by a number, the calculation of x/y = fix(x/y) works nicely. ;-)