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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CountDown with format 00:00:00 in access



 
 
Thread Tools Display Modes
  #1  
Old December 30th, 2006, 05:39 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 23
Default CountDown with format 00:00:00 in access

hi there everyone. I know this topic has been going on for some time
now. but really I need your help. I wish to create a countdown in an
access form so that when the timer is up a message box pops up and says
time is up. You see I wish the count down to be in hours, minutes and
seconds.
Something like 00:40:00 and when the countdown starts it goes 00:39:59
and so on. I know how to do it with seconds only but no with this
format.Can anyone help me please!!. I really need it for my coursework.
An example with a download would be very helpful.
Thanks in Advance!!!!

  #2  
Old December 30th, 2006, 06:02 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default CountDown with format 00:00:00 in access

Assuming you've got a text box txtTimer on your form, when you want to start
the timer, set

Me.TimerInterval = 1000
Me.txtTimer = Format(#00:40:00#, "hh:nn:ss")

For the form's Timer event, put:

Private Sub Form_Timer()
Dim dtmCurr As Date

dtmCurr = CDate(Me.txtTimer)
If dtmCurr 0 Then
Me.txtTimer = Format(DateAdd("s", -1, dtmCurr), "hh:nn:ss")
Else
Me.TimerInterval = 0
Me.txtTimer = Null
MsgBox "Time's up!"
End If
End Sub



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


wrote in message
ups.com...
hi there everyone. I know this topic has been going on for some time
now. but really I need your help. I wish to create a countdown in an
access form so that when the timer is up a message box pops up and says
time is up. You see I wish the count down to be in hours, minutes and
seconds.
Something like 00:40:00 and when the countdown starts it goes 00:39:59
and so on. I know how to do it with seconds only but no with this
format.Can anyone help me please!!. I really need it for my coursework.
An example with a download would be very helpful.
Thanks in Advance!!!!



  #3  
Old December 30th, 2006, 06:09 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 23
Default CountDown with format 00:00:00 in access

Thanks a Lot!!!! man you are great. I don't know how to thank you. I
owe you one. Maybe I will be able to help you another time if you need
help.



Douglas J. Steele wrote:
Assuming you've got a text box txtTimer on your form, when you want to start
the timer, set

Me.TimerInterval = 1000
Me.txtTimer = Format(#00:40:00#, "hh:nn:ss")

For the form's Timer event, put:

Private Sub Form_Timer()
Dim dtmCurr As Date

dtmCurr = CDate(Me.txtTimer)
If dtmCurr 0 Then
Me.txtTimer = Format(DateAdd("s", -1, dtmCurr), "hh:nn:ss")
Else
Me.TimerInterval = 0
Me.txtTimer = Null
MsgBox "Time's up!"
End If
End Sub



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


wrote in message
ups.com...
hi there everyone. I know this topic has been going on for some time
now. but really I need your help. I wish to create a countdown in an
access form so that when the timer is up a message box pops up and says
time is up. You see I wish the count down to be in hours, minutes and
seconds.
Something like 00:40:00 and when the countdown starts it goes 00:39:59
and so on. I know how to do it with seconds only but no with this
format.Can anyone help me please!!. I really need it for my coursework.
An example with a download would be very helpful.
Thanks in Advance!!!!


  #4  
Old December 30th, 2006, 06:09 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 23
Default CountDown with format 00:00:00 in access

Thanks a Lot!!!! man you are great. I don't know how to thank you. I
owe you one. Maybe I will be able to help you another time if you need
help.



Douglas J. Steele wrote:
Assuming you've got a text box txtTimer on your form, when you want to start
the timer, set

Me.TimerInterval = 1000
Me.txtTimer = Format(#00:40:00#, "hh:nn:ss")

For the form's Timer event, put:

Private Sub Form_Timer()
Dim dtmCurr As Date

dtmCurr = CDate(Me.txtTimer)
If dtmCurr 0 Then
Me.txtTimer = Format(DateAdd("s", -1, dtmCurr), "hh:nn:ss")
Else
Me.TimerInterval = 0
Me.txtTimer = Null
MsgBox "Time's up!"
End If
End Sub



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


wrote in message
ups.com...
hi there everyone. I know this topic has been going on for some time
now. but really I need your help. I wish to create a countdown in an
access form so that when the timer is up a message box pops up and says
time is up. You see I wish the count down to be in hours, minutes and
seconds.
Something like 00:40:00 and when the countdown starts it goes 00:39:59
and so on. I know how to do it with seconds only but no with this
format.Can anyone help me please!!. I really need it for my coursework.
An example with a download would be very helpful.
Thanks in Advance!!!!


 




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 07:15 AM.


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