If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Countdown timer
can anyone give me a simple code in creating a countdown timer in ms access
2003? Thanks -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Countdown timer
not sure if this is what you're looking for...
i have a form with a hidden unbound textbox control named txtTime, and a visible unbound textbox control named txtCountdown. in the form's Load event, i set txtTime to Now. the form's TimerInterval property is set to 1000 (= 1 second). the following code runs in the form's Timer event procedure, as Private Sub Form_Timer() Dim lng As Long, sec As Long lng = DateDiff("s", Nz(Me!txtTime, Date), Now) If 60 - (lng Mod 60) = 60 Then sec = 0 lng = lng - 60 Else sec = 60 - (lng Mod 60) End If lng = 14 - Fix(lng / 60) If lng 1 Then Me!txtCountdown.ForeColor = 255 Me!txtCountdown = Format(lng, "00") & ":" & Format(sec, "00") End Sub the code runs once a second, changing the value of txtCountdown, counting backward from 15:00 minutes to 00:00, and changing the forecolor of txtCountdown to red when less than one minute remains in the countdown. hth "Dinmar via AccessMonster.com" u46683@uwe wrote in message news:8b3d57e025cdc@uwe... can anyone give me a simple code in creating a countdown timer in ms access 2003? Thanks -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|