On my main form F_Orders i have two text box's. One contains and order date and one contains a required by date.
I want to create a macro or something that will check the validation of these entries before the order is confirmed.
In this case if the required date is earlier than the date ordered an error message is shown.
Here is my attempt so far.
The error i am getting is invaid use of Me keyword. I dont understand why this is wrong. Am i not selecting the field on my F_Orders form properly?
Any help would be great. Thanks in advance!
I want to create a macro or something that will check the validation of these entries before the order is confirmed.
In this case if the required date is earlier than the date ordered an error message is shown.
Here is my attempt so far.
Code:
Sub Date_Validation()
If Me.DateRequired.Value < Me.OrderDate.Value Then
MsgBox "The date required is ealier than the date ordered" & vbCrLf & _
"Please select a date required later than the date ordered"
End If
End Sub
The error i am getting is invaid use of Me keyword. I dont understand why this is wrong. Am i not selecting the field on my F_Orders form properly?
Any help would be great. Thanks in advance!