|
-
Jul 15th, 2003, 11:35 PM
#1
Thread Starter
Lively Member
Question about the Error Provider
Can you use one error provider to validate multiple controls on a form. I am using one on a form that will validate the controls the first time there is an error in the first control but if the error is fixed in the first control and not fixed in the secon control the error provider goes away. Is there something wrong with the code that I have posted below. It checks two text boxes and makes sure that they contain Alpha characters and not Numeric numbers as the first character.
Private Sub txtAccountName_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtAccountName.Validating
If IsNumeric(txtAccountName.Text) Then
ErrorProvider1.SetError(txtAccountName, "Not a numeric value.")
Else
' Clear the error.
ErrorProvider1.SetError(txtAccountName, "")
End If
End Sub
Private Sub txtIssuingBank_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtIssuingBank.Validating
If IsNumeric(txtAccountName.Text) Then
ErrorProvider1.SetError(txtIssuingBank, "Not a numeric value.")
Else
' Clear the error.
ErrorProvider1.SetError(txtIssuingBank, "")
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|