Adjustment for timer needed

AthenaSpirit

Registered User.
Local time
Today, 10:26
Joined
Aug 18, 2014
Messages
14
Hello,

I have looked for other posts however either they just count down in seconds, do not have the format I would like, or I simply dont understand them...

How I adjust the below countdown code to be formatted in HH:nn:ss??
I need a countdown of 5 minutes and for the label to display as such.

It is currently set at only 20 seconds, but I do not know how to enter 5 mins in this value, so have left it as my last working example..

I would be grateful for any advice,



Code:
Option Compare Database

Private Sub Form_Open(Cancel As Integer)
Me.txtTimer.Value = 20
' Seconds to countdown from


End Sub

Private Sub Form_Timer()

Me.txtTimer.Value = Me.txtTimer.Value - 1
' Countdown in seconds
If Me.txtTimer.Value = 0 Then
labTimesUp.Visible = True
Me.TimerInterval = 0
Else
End If
End Sub
 
Thank you for the reply, yes, I have the form timer to interval = 1000.
 
I've just translated what the timer interval uses.
1000 TimerInterval means 1 second
60,000 TimerInterval means 60 seconds (or 1 minute).
 
Yes, my FormTimer is TimerInterval is set to 1000 = 1 sec and calls the above code, which countdowns by 1 each second.

The countdown itself appears and works fine. Currently it is merely doing a countdown from whatever number I've assigned the value too. My issue I would like help with is the format it is using, I just wish to change the format into Time, so on my label it appears as a NN:SS format.

Is this possible?
 
You misunderstand what I'm saying. If you set the timer interval to 1000 then it will stop after 1 second. So if you want it to run for 5 minutes then you need to multiply 1000 by 5 minutes.

It counts down by itself. You don't need to count it down.
 
Yes. That code is assigned a label that merelys display a set time that remains. Anuway the formatting worked and it running well. Thank you again.
 
Alright I see. I was just curious because you said 1 second and 1 second isn't enough to see the formatting work.

You're welcome!
 

Users who are viewing this thread

Back
Top Bottom