I'm trying (unsuccessfully) to use a string array during a loop statement. My goal is to validate a group of textboxes while leaving a few others out of the validation loop. I want to avoid validating two textboxes with the names of txtAccountingID and GrantDuration. I would really like to use an array to represent the list of textboxes I don't want to validate.
My problem seems to lie in the For statement - Ctrl.Name <> TextBoxName() - see code below
Can anyone guide me on how to use an array to represent a list of names?
Dim Ctrl As Control
Dim RedInt As Integer
Dim TextBoxName(1) As String
RedInt = 0
TextBoxName(0) = "txtAccountingID"
TextBoxName(1) = "GrantDuration"
For Each Ctrl In Controls
If TypeOf Ctrl Is TextBox And Ctrl.Name <> TextBoxName() Then
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert