M
melwester
Hi Ken,
Still trying to get my dates to work. With the code you supplied before
when I test it I do dates less then 2002 and more than 2005 (i.e 2000 or
2006) this works fine. But when I try to erase the date to go to the next
field I get "Run time error 94 - Invalid use of Null message".
The user is going to have to be able to delete the date that is in the date
field and tab to the next field.
Here is the code:
Private Sub CADLDL_Date_Text_BeforeUpdate(Cancel As Integer)
Dim TextDate As Date
TextDate = DateSerial(Right(Me!CAD_LDL_Date.Value, 4), _
Left(Me!CAD_LDL_Date.Value, 2), _
Mid(Me!CAD_LDL_Date.Value, 3, 2))
Select Case TextDate
Case #10/1/2002# To #9/30/2005#
'do nothing'
Case Else
MsgBox "You have entered an invalid date."
Cancel = True
End Select
End Sub
Someone had mention changing the Cancel to = False, tried this and it still
doesn't work. Have any ideas on this?
Thanks.
Still trying to get my dates to work. With the code you supplied before
when I test it I do dates less then 2002 and more than 2005 (i.e 2000 or
2006) this works fine. But when I try to erase the date to go to the next
field I get "Run time error 94 - Invalid use of Null message".
The user is going to have to be able to delete the date that is in the date
field and tab to the next field.
Here is the code:
Private Sub CADLDL_Date_Text_BeforeUpdate(Cancel As Integer)
Dim TextDate As Date
TextDate = DateSerial(Right(Me!CAD_LDL_Date.Value, 4), _
Left(Me!CAD_LDL_Date.Value, 2), _
Mid(Me!CAD_LDL_Date.Value, 3, 2))
Select Case TextDate
Case #10/1/2002# To #9/30/2005#
'do nothing'
Case Else
MsgBox "You have entered an invalid date."
Cancel = True
End Select
End Sub
Someone had mention changing the Cancel to = False, tried this and it still
doesn't work. Have any ideas on this?
Thanks.