Hello all,
I'm trying to change the propeties of 4 controls all at once using a collections object. Is this correct? I have to add them to a custom collection first, because I don't want all the controls (text boxes) on the form to change, only certain ones.
How can I get it to work?
Here's my code:
I'm trying to change the propeties of 4 controls all at once using a collections object. Is this correct? I have to add them to a custom collection first, because I don't want all the controls (text boxes) on the form to change, only certain ones.
How can I get it to work?
Here's my code:
Code:
Private Sub lblEditInfo_Click()
Dim colTextBoxes As Collection
Dim counter As Integer
colTextBoxes.Add Me.Controls("txtPayorName"), 1
colTextBoxes.Add Me.Controls("txtName"), 2
colTextBoxes.Add Me.Controls("txtNickname"), 3
colTextBoxes.Add Me.Controls("txtExternalID"), 4
For counter = 1 To colTextBoxes.Count
With colTextBoxes(counter)
.BackColor = "15783845"
.Locked = False
.ForeColor = "0"
End With
Next
End Sub
Comment