So; I found this code and it works but a few things I need to modify that I’m having trouble with.
Code:
Option Compare Database
Option Explicit
‘Declare a Form Global variable to hold the
‘seconds expired since Form was opened.
Dim TimeCount As Long
Private Sub Form_Open(Cancel As Integer)
‘Set the Form’s Timer to 1 second intervals (1000 tics = 1 Second)
Me.TimerInterval = 1000
End Sub
Private Sub Form_Timer()
'Increment the TimerCount variable by 1
TimeCount = TimeCount + 1
'Display the current seconds remaining in the 'text box corner of form
Me.txtCounter.Value = 60 - TimeCount
'If the Seconds Counter (TimerCount) is now equal
'to 40 seconds then the text color changed to Red
If TimeCount = 40 Then
Me.txtCounter.ForeColor = vbRed
End If
If TimeCount = 61 Then
'Close the Access Program when the counter is equal to 61 seconds
DoCmd.Quit acQuitSaveAll
End If
End Sub
1st-This sets the countdown to 60 secs; I need to change to 60 minutes. Also; this shows the countdown as a whole number; ex.
60, 55, 58 ….I need it in mm:ss like 59:10, 59:09….
2nd-Form_Timer code shows that at 20secs left will turn to red. I not only need the counter to turn red at 40 but before I would like from 59mins to 16 green; 15mins to 6mins yellow and the final 5mins red. Can someone help please…