Dim SampleDateTimeValue As Date Dim IsValidDateTime As Boolean SampleDateTimeValue = DateSerial(2002, 12, 2) + TimeSerial(11, 34, 45) IsValidDateTime = IsDate(SampleDateTimeValue) 'Returns True SampleDateTime = CDate(txtDateTime.Text) If Not IsDate(SampleDateTimeValue) Then MsgBox "Please enter valid date and time!", vbExclamation + vbOKOnly, "Error" EndIf
Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000) br>
VB (.NET) - what other language do you need in the whole Universe?...