Date Comparrison Error Message?

scouser

Registered User.
Local time
Today, 23:12
Joined
Nov 25, 2003
Messages
767
I have 2 date fields on my 'Order' form:

Order Date (Default value (=Now))
ConfirmedServiceDate

I want an error message displayed if the date entered in the ConfirmedServiceDate is less than the OrderDate and to cancel any updates.

Can anyone advise the syntax or how I go about this? I have been looking in the help file at expression builder but with little success as when I create an expression and try it out I get an error saying can not find macro? (I know it's because I have built expression wrong!!).
Thanks in advance,
Phil.
 
In the Form Before Update property you will need some code to check the dates-

It will look something like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Me.ConfirmedServiceDate < Me.OrderDate Then
MsgBox "The Confirmed Service Date must be later than the Order Date", vbOKOnly
Cancel = True
End If

End Sub

GumbyD
 
Thanks

Cheers Gumby that worked a treat.
Phil.
 

Users who are viewing this thread

Back
Top Bottom