Hi Alex,
You can convert the string to a date and test it with isdate. But do it
inside a try catch block or it will fail:
Dim st2 As String
st2 = "14/35/03"
Try
If IsDate(CDate(st2)) Then
MessageBox.Show(st2)
End If
Catch
MessageBox.Show("not a valid date")
End Try
HTH,
Bernie Yaeger
"alex" <ai******@hotmail.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Hi,
is there an easy way in vb to test a string for a valid date (to pass to
a db) like YYYYMMDD or YYYY-MM-DD ?
Thanks
Alex