Timer event either not triggering, or not working

  • Thread starter Thread starter Duncs
  • Start date Start date
D

Duncs

I have a timer event, that updates a clock and a random quote of the
day. The timer dlay is set to 1000, and the Time Event is as follows:

Private Sub Form_Timer()

Static iCount As Integer

Me!lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss
AMPM")

iCount = iCount + 1
If iCount >= 30 Then
iCount = 0
Me.lblQuoteOfTheDay.Caption = DLookup ("fldQuote",
"tblQuoteOfTheDay", "[fldQuoteNum]=" & Int((lngQuoteCount * Rnd()) +
1))
End If

End Sub

The problme I have is that the update works fine when the form is first
loaded. However, after about five minutes of being the non-active
window, the timer event appears to be not firing. The clock no longer
updates and the quote of the day no longer changes.

Anyone any ideas?

Duncs
 
hi,
The problme I have is that the update works fine when the form is first
loaded. However, after about five minutes of being the non-active
window, the timer event appears to be not firing. The clock no longer
updates and the quote of the day no longer changes.
Using Repaint should do it:

lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
lblClock.Repaint

If not use also

Me.Repaint

and or

DoEvents


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple Timer Events 2
Not enough memory to refresh display 6
Cancel timer event if criteria not met 1
clock 2
Timer Count 9
Forms Error Timer 3
Time VB 2
Clock or operator error? 2

Back
Top