Message timer

J

Jody K

I would like for a message box to appear at lets say 5:45 am and 5:45 pm. I
simply want the message box to remind the user to update another form. What
would be the best way to accomplish this? Does anyone have an example?

Thanks in advance for any help!
Jody K.
 
S

Steve Schapel

Jody,

I suppose you could use the Timer event of a form that would always be open.

It depends how accurate you want to be with the times you mentioned.
If, for example, "within 2 minutes of 5:45" is acceptable, then you
could set the Timer Interval property of the form to 24000 (4 minutes).
And then in the On Timer event property of the form you could put code
like this...
If (Time >= #5:43:00# And Time < #5:47:00#) Or _
(Time >= #17:43:00# And Time < #17:47:00#) Then
MsgBox "Ding dong", vbInformation, "Reminder"
End If

As a refinement, you could set the Timer Interval initially to an hour
(3600000), for example. Then, the Timer code something like this...
If Hour(Time) = 5 Or Hour(Time) = 17 Then
Me.TimerInterval = 24000
End If
If (Time >= #5:43:00# And Time < #5:47:00#) Or _
(Time >= #17:43:00# And Time < #17:47:00#) Then
Me.TimerInterval = 3600000
MsgBox "Ding dong", vbInformation, "Reminder"
End If
 
Top