Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time activated MsgBox 1

Status
Not open for further replies.

bfalkowski

Programmer
Dec 20, 2001
2
US
Does anyone have a script for a MsgBox that launches at a specified time interval? I want to make a reminder box that goes off every 10 minutes.

Bryan
 
bfalkowski,

Hello there, If I'm understanding what your asking for you could drop a Timer Control on your Form and set the Interval property to 60000 which is (1 Minute) the Maximum you can set the property to is 65535. Then add the following code:

Dim minutes As Integer

Private Sub Timer1_Timer()
minutes = minutes + 1

If minutes = 10 Then
MsgBox "Beep! Beep!"
minutes = 0
End If

End Sub

Or, maybe you could use variable = Time in the Timer1_Timer routine and use the Mod operator to see if the minutes portion is divisible by 10, rather than adding to a variable, then it would fire when the system time was 10,20,30 etc minutes after the hour.

Just a couple of suggestion that may be helpful to you.

Later,

Ferlin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top