Private Sub tmrTrigger_Timer()
' See if it time for the event.
If Timer >= NextEventTime Then
' Process the event.
lblEventTime.Caption = Format$(DateAdd("s", _
INTERVAL_SECONDS, Time))
' Set the new event time.
NextEventTime = NextEventTime + INTERVAL_SECONDS
End If
' Set the timer's interval.
If NextEventTime - Timer < 60 Then
tmrTrigger.Interval = (NextEventTime - Timer) * 1000
Else
tmrTrigger.Interval = 60000
End If
End Sub
|