A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Countdown timer



 
 
Thread Tools Display Modes
  #1  
Old October 6th, 2008, 03:29 AM posted to microsoft.public.access.tablesdbdesign
Dinmar via AccessMonster.com
external usenet poster
 
Posts: 1
Default 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  
Old October 6th, 2008, 06:51 AM posted to microsoft.public.access.tablesdbdesign
tina
external usenet poster
 
Posts: 1,997
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.