Validating Dates in Textboxes
Hello,
I tried this birthdate validation code but it still pops up a message box when I correctly enter a date in the same format of
Year-Month-Day
VB Code:
'Validating Date of Birth so the format should be Year-Month-Day
Private Sub txtDOB_Validate(Cancel As Boolean)
If txtDOB.Text <> Format$("yyyy-MM-dd") Then
MsgBox "The Date of Birth (DOB) must be of this format:
Year-Month-Day.", vbInformation, "Validation"
txtDOB.TabIndex = 10
End If
End Sub
Any Suggestions? Thanks
chris