Hi
I popped a bit of code in the AfterUpdate event of the textbox to try to ensure that the date entered was sort of valid i.e. between two weeks ago and four weeks hence.
It seems to say everything is out of range so far as I can see
The code is
I fully accept it may be my bleary post New Year eyes are missing something very obvious or it may be that I have to use # around date construct.
Can anyone please spot the error?
Many thanks in anticipation
Hope you all had a good New Year
I popped a bit of code in the AfterUpdate event of the textbox to try to ensure that the date entered was sort of valid i.e. between two weeks ago and four weeks hence.
It seems to say everything is out of range so far as I can see
The code is
Code:
' Test to see that date is within reasonable parameters
If Me.txtDate < Date - 14 Or Me.txtDate > Date + 28 Then
MsgBox "The date is outwith the set limits", vbOKOnly, "MicaPharm Data Validation"
Me.txtDate.SetFocus
Exit Sub
End If
Can anyone please spot the error?
Many thanks in anticipation
Hope you all had a good New Year