Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form timer event

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
I've all ready have code to flash label every 1 second or so... but what i would like to do have another timer event to flash another label every 5 seconds.

Can this be done... is it posible to describe it in easy steps and a sample code will be very helpful

many thanks.
 
I am fairly sure there was a post about this, but I can't find it. Something on these lines, I think:
Code:
Dim intCount

Private Sub Form_Timer()
intCount = intCount + 1
Me.txt1Sec = Now()
If intCount Mod 5 = 0 Then
    Me.txt5Secs = Now()
End If
End Sub
 

You cannt have two timer controls on the same control!
But in your case you could use a static variable increased on every sec by 1 and check if that value equals 5. When true execute the 5seconds code and reset static variable to 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top