Interesting question. But now I have a question: If I start at 8:15 AM, do you want to reset the control at 9:15AM (after 1 hour) or at 9:00AM (on the hour)?
If you want "on the hour", I found some code on the access-programmers.co.uk forum on 10-02-2008 by missinglinq that will work.
Create an unbound text box and name it txtOmega
If you don't want to display the seconds (10:15 AM) set the format to "Medium Time"
Add this code to the form:
Code:
Private Sub Form_Open(Cancel As Integer)
'Author missinglinq 10-02-2008, access-programmers.co.uk
'Displays while waiting for timer to crank up
Me.txtOmega = Time
End Sub
Private Sub Form_Timer()
'Author missinglinq 10-02-2008, access-programmers.co.uk
Me.txtOmega = Time 'Display time
If Minute(Me.txtOmega) = 0 And Second(Me.txtOmega) = 0 Then
Me.YourCBO = 0
End If
End Sub
Change YourCBO to your control name.
Set the form's TimerInterval to 1000
-------------------------------------------------
If you want to have buttons to start and stop the timer, add two buttons called cmdClockStart and cmdClockEnd and attach respective code to each to have the clock run on demand.
'***************** Code Start ***************
Private Sub cmdClockStart_Click()
Me.TimerInterval = 1000
End Sub
Private Sub cmdClockEnd_Click()
Me.TimerInterval = 0
End Sub
'***************** Code End ***************