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:
  1. 'Validating Date of Birth so the format should be Year-Month-Day
  2. Private Sub txtDOB_Validate(Cancel As Boolean)
  3.     If txtDOB.Text <> Format$("yyyy-MM-dd") Then
  4.         MsgBox "The Date of Birth (DOB) must be of this format:
  5.         Year-Month-Day.", vbInformation, "Validation"
  6.         txtDOB.TabIndex = 10        
  7.     End If
  8. End Sub

Any Suggestions? Thanks

chris