Hi,
I have the following validation which works fine for numeric textbox i.e., txtprojstart, however I want to update it for datetime textbox instead of numeric any help please... See code below
Code:Private Sub txtprojstart_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtprojstart.Validating If Not IsNumeric(txtprojstart.Text) And txtprojstart.Text <> "" Then ' Cancel the event moving off of the control. e.Cancel = True ' Select the offending text. txtprojstart.Select(0, txtprojstart.Text.Length) ' Give the ErrorProvider the error message to display. ErrorProvider.SetError(txtprojstart, "Enter correct date format") End If End Sub]
thanksCode:Private Sub txtprojstart_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtprojstart.Validated ErrorProvider.SetError(txtprojstart, "") End Sub




Reply With Quote