diensatthan
Registered User.
- Local time
- Today, 14:43
- Joined
- Apr 27, 2003
- Messages
- 14
Private Sub txtDate_BeforeUpdate(Cancel As Integer)
If IsDate(txtDate) Then
MsgBox "Valid Date entered" 'Msg1
Else
MsgBox "Invalid Date entered!" 'Msg2
End If
End Sub
The code above works OK for: a valid txtDate (Msg1 is displayed),
and an empty txtDate (Msg2 is displayed). However, if I entered "ABC" into the text box, I got an Access generic error message instead of the expected Msg2. Please help me with the date validation. Thanks.
If IsDate(txtDate) Then
MsgBox "Valid Date entered" 'Msg1
Else
MsgBox "Invalid Date entered!" 'Msg2
End If
End Sub
The code above works OK for: a valid txtDate (Msg1 is displayed),
and an empty txtDate (Msg2 is displayed). However, if I entered "ABC" into the text box, I got an Access generic error message instead of the expected Msg2. Please help me with the date validation. Thanks.