how do i limit entry into a textbox to either a 7 digit number or 6 digit alphanumeric string? I have tried the following code but no luck, is it a syntax error? can anyone help?
If Not (txtFileName.Text = "[0-9],[0-9],[0-9],[0-9],[0-9],[0-9],[0-9]" Or txtFileName.Text = "[0-9],[0-9],[0-9],[0-9],[0-9],[A-Z]") Then
ErrorProvider1.SetError(txtFileName, "Incorrect Number!")
txtFileName.Focus()
txtFileName.Undo()
txtFileName.Clear()
Else : ErrorProvider1.SetError(txtFileName, Nothing)
End If
If Not (txtFileName.Text = "[0-9],[0-9],[0-9],[0-9],[0-9],[0-9],[0-9]" Or txtFileName.Text = "[0-9],[0-9],[0-9],[0-9],[0-9],[A-Z]") Then
ErrorProvider1.SetError(txtFileName, "Incorrect Number!")
txtFileName.Focus()
txtFileName.Undo()
txtFileName.Clear()
Else : ErrorProvider1.SetError(txtFileName, Nothing)
End If