Hello Folks,
I have ten timers that run at given points. 95 % of the time they work fine, but once an awhile they will fire early why is this?
Here is my code. I'm I doing something wrong that allow for the once an awhile early firing?
In Userform1 module
In module1
In userform1
In Userform1
I have ten timers that run at given points. 95 % of the time they work fine, but once an awhile they will fire early why is this?
Here is my code. I'm I doing something wrong that allow for the once an awhile early firing?
In Userform1 module
Code:
Private Sub Benontimer()
If Benlatetime = 0 Then
Benlatetime = Date + CDate(UserForm1.TextBox46) + TimeValue("0:01") 'yellow
Application.OnTime Benlatetime, "Module1.Benontimer3"
If Benlatetime2 = 0 Then
Benlatetime2 = Date + CDate(UserForm1.TextBox46) + TimeValue("0:05") 'red
Application.OnTime Benlatetime2, "Module1.Benontimer30"
End If
End If
End Sub
In module1
Code:
Public Sub Benontimer3()
UserForm1.Benontimer3
End Sub
Code:
Public Sub Benontimer30()
UserForm1.Benontimer30
End Sub
In userform1
Code:
Public Sub BenOnTimeClear()
On Error Resume Next
Application.OnTime Benlatetime, "Module1.Benontimer3", Schedule:=False
Benlatetime = 0
Application.OnTime Benlatetime2, "Module1.Benontimer30", Schedule:=False
Benlatetime2 = 0
End Sub
In Userform1
Code:
Public Sub Benontimer3()
' UserForm1.Frame14.BorderColor = vbYellow
' UserForm1.Frame14.ForeColor = vbYellow
UserForm1.TextBox46.BackColor = vbYellow
' UserForm1.TextBox41.BackColor = vbYellow
End Sub
Code:
Public Sub Benontimer30()
' UserForm1.Frame14.BorderColor = vbRed
' UserForm1.Frame14.ForeColor = vbRed
'UserForm1.TextBox41.BackColor = vbRed
UserForm1.TextBox46.BackColor = vbRed
End Sub