Access 2003 Date validation on a form

  • Thread starter Thread starter Ward Horsfall
  • Start date Start date
W

Ward Horsfall

Hi,

I am looking for some code / example to perform date validation on a
field. Has anybody got same sample code on how todo this on a
Access 2003 form.

Thanks,

Ward.
 
MsgBox IsDate(Me.txtDate)
MsgBox Me.txtDate > Date()
If Me.txtDate < Date() - 30 Then
MsgBox "Over Due by 30 Days"
End If
 
Thanks for your help,

Ward.

SHIPP said:
The function IsDate contained in Access 2003 will handle validation.

Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "February 12, 1969": YourDate = #2/12/69#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' Returns True.
MyCheck = IsDate(YourDate) ' Returns True.
MyCheck = IsDate(NoDate) ' Returns False.
 
Back
Top