VALIDATING TIME FIELD WITH VALIDATION RULE

I have an ADP database that when entering a time with Short Time format as a textbox allows 00:70 and then freezes my system.  How can I trap this somehow before it locks up the system.  Maybe in the validation rule or something.
InvisibleManAsked:
Who is Participating?
 
xSinbadConnect With a Mentor Commented:
example;

Private Sub Text0_Change()
Dim val As String, valMin As Double
val = Right(Me.Text0, 2)
valMin = CDbl(val)
If valMin > 60 Then
Me.Text0 = "00.00"
MsgBox "Problem with the minutes"
End If
End Sub
0
 
xSinbadCommented:
You could have an on change event that does a right for two characters and check to seee if they are less than 60.
0
 
Ryan ChongCommented:
Hi,

Use IsDate Function?
0
 
xSinbadCommented:
InvisibleMan did my comment solve your problem? If it didnt then please dont accept it as an answer. I would rather not have it than have a C.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.