B
bw
I want to perform a BeforeUpdate check on a date containing a date.
The procedure is shown below, and works fine when I manually enter the date.
Private Sub CarDateOut_BeforeUpdate(Cancel As Integer)
If CarDateOut < Forms!Maketravelrequest!TravelDate Then
MsgBox "Car DateOut must be >= Travel Date"
Cancel = True
End If
End Sub
However, if I update the control using the following, the BeforeUpdate
procedure above does not get executed.
I have shown where I want to insert code to indicate that a change to the
control has been made.
Can someone provide the code to do this, OR, tell me whats wrong with what
I'm trying to do?
Private Sub CarOut_Click()
On Error GoTo Err_CarOut_Click
WhichCalendar = 3
Call CalendarFor([CarDateOut], "Date Out")
'Insert code here to make the "CarDateOut_BeforeUpdate" procedure exit.
End Sub
Thanks,
Bernie
The procedure is shown below, and works fine when I manually enter the date.
Private Sub CarDateOut_BeforeUpdate(Cancel As Integer)
If CarDateOut < Forms!Maketravelrequest!TravelDate Then
MsgBox "Car DateOut must be >= Travel Date"
Cancel = True
End If
End Sub
However, if I update the control using the following, the BeforeUpdate
procedure above does not get executed.
I have shown where I want to insert code to indicate that a change to the
control has been made.
Can someone provide the code to do this, OR, tell me whats wrong with what
I'm trying to do?
Private Sub CarOut_Click()
On Error GoTo Err_CarOut_Click
WhichCalendar = 3
Call CalendarFor([CarDateOut], "Date Out")
'Insert code here to make the "CarDateOut_BeforeUpdate" procedure exit.
End Sub
Thanks,
Bernie