T
Tina Hudson
Hello!
I have code in the change property for the field "StaffDate" that checks to
see if the date entered is later than today. The following code doesn't
work, as if I enter today's date, I get the error message. Any help will be
appreciated.
Here is my code:
Private Sub StaffDate_Change()
With Me
If Me.StaffDate > Now() Then
MsgBox "You entered a date in the future. The date of the staffing
can not be later than today's date. Press OK to continue.", vbOKOnly,
"Invalid Staffing Date"
DoCmd.GoToControl "StaffDate"
ElseIf Me.StaffDate < #1/1/2007# Then
MsgBox "You entered an incorrect date. The date of the staffing may
not be earlier than January 1, 2007. Press OK to continue.", vbOKOnly,
"Invalid Staffing Date"
DoCmd.GoToControl "StaffDate"
End If
End With
End Sub
I have code in the change property for the field "StaffDate" that checks to
see if the date entered is later than today. The following code doesn't
work, as if I enter today's date, I get the error message. Any help will be
appreciated.
Here is my code:
Private Sub StaffDate_Change()
With Me
If Me.StaffDate > Now() Then
MsgBox "You entered a date in the future. The date of the staffing
can not be later than today's date. Press OK to continue.", vbOKOnly,
"Invalid Staffing Date"
DoCmd.GoToControl "StaffDate"
ElseIf Me.StaffDate < #1/1/2007# Then
MsgBox "You entered an incorrect date. The date of the staffing may
not be earlier than January 1, 2007. Press OK to continue.", vbOKOnly,
"Invalid Staffing Date"
DoCmd.GoToControl "StaffDate"
End If
End With
End Sub