Hi All,
I have a form which has three controls which must be populated or else the database would be useless. The fields are
TodaysDate
cboSelName
cbo_PickTime
I've tried the code below which seemed to work one day and then not work the following day which i found strange ? Can anybody see something obvious ?
Thanks
I have a form which has three controls which must be populated or else the database would be useless. The fields are
TodaysDate
cboSelName
cbo_PickTime
I've tried the code below which seemed to work one day and then not work the following day which i found strange ? Can anybody see something obvious ?
Thanks
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord And Me.TodaysDate <= Date And TimeValue(Me.TimeNow) > #10:00:00 AM# Then
MsgBox "Bookings can NOT be made after 10:00am" & vbCrLf & _
"Please book for tomorrow.", , "Booking Cancelled"
Cancel = True
Me.Undo
Me.cboSelName.SetFocus
End If
If IsNull(TodaysDate.Value) Then
MsgBox "You must select a date."
Cancel = True
TodaysDate.SetFocus
End If
If IsNull(cboSelName.Value) Then
MsgBox "You must enter your name."
Cancel = True
cboSelName.SetFocus
End If
If IsNull(cbo_PickTime.Value) Then
MsgBox "You must select a time slot."
Cancel = True
cbo_PickTime.SetFocus
End If
End Sub