R
Radhika
I have a form with a field called 'Date'. I want those entering data into
this form to only be able to enter dates between 1/1/2009 and 1/31/2009.
This is what I tried:
In the before update event of 'Date' I put in the following code:
Private Sub Date_BeforeUpdate(Cancel As Integer)
Const ConMESSAGE = _
"Please enter a date > 1/1/2009 and <1/31/2009"
If Not IsNull(Me.[Date]) Then
If [Date] > "1/31/2009" Then
MsgBox ConMESSAGE, vbExclamation, "Invalid Operation"
Cancel = True
End If
End Sub
However, this only gives me an error msg if the date is not 1/31/2009. What
am i doing wrong?
Thank you
Radhika
this form to only be able to enter dates between 1/1/2009 and 1/31/2009.
This is what I tried:
In the before update event of 'Date' I put in the following code:
Private Sub Date_BeforeUpdate(Cancel As Integer)
Const ConMESSAGE = _
"Please enter a date > 1/1/2009 and <1/31/2009"
If Not IsNull(Me.[Date]) Then
If [Date] > "1/31/2009" Then
MsgBox ConMESSAGE, vbExclamation, "Invalid Operation"
Cancel = True
End If
End Sub
However, this only gives me an error msg if the date is not 1/31/2009. What
am i doing wrong?
Thank you
Radhika