Researcher
I.T. Veteran
- Local time
- Today, 07:01
- Joined
- Oct 11, 2006
- Messages
- 42
Im using a form to enter date and time data into four separate fields. I have sequential validation working ok, but now I need to modify the validation to not accept any time entries that are beyond 2 hours apart in the last three fields.
Fields:
Ticket (Time Printed)
*Time In (Time TIC)
*Time Call (Time Processed)
*Time Paid (Time PUFC)
- (Actual field Names)
Below is the code I have so far:
Private Sub Time_TIC_BeforeUpdate(Cancel As Integer)
If Time_TIC.Value <= Time_Printed.Value Then
MsgBox ("Time In is not valid!")
Cancel = True
End If
If Me.Time_TIC > Time_Printed And _
Me.Time_TIC > DateAdd("h", 2, Me.Time_TIC) Then
MsgBox "Your Time entry is greater than 2 hours! Please check the Time In entry again on the Jackpot Log"
Exit Sub
End If
End Sub
If the time entries are less than two hours, I want to exit sub
Thanx for any help in advance..
Fields:
Ticket (Time Printed)
*Time In (Time TIC)
*Time Call (Time Processed)
*Time Paid (Time PUFC)
- (Actual field Names)
Below is the code I have so far:
Private Sub Time_TIC_BeforeUpdate(Cancel As Integer)
If Time_TIC.Value <= Time_Printed.Value Then
MsgBox ("Time In is not valid!")
Cancel = True
End If
If Me.Time_TIC > Time_Printed And _
Me.Time_TIC > DateAdd("h", 2, Me.Time_TIC) Then
MsgBox "Your Time entry is greater than 2 hours! Please check the Time In entry again on the Jackpot Log"
Exit Sub
End If
End Sub
If the time entries are less than two hours, I want to exit sub
Thanx for any help in advance..