Have the following code:
Me.Controls("BallsLbl").Caption = 600
Dim n As Integer
For n = 1 To 40
Debug.Print Me.Controls("BallsLbl").Caption
Debug.Print Me.Controls("Bay" & n).BackColor
Debug.Print Me.Controls("T" & n).Value
If Me.Controls("Bay" & n).BackColor = vbRed Then
Me.Controls("T" & n).Value = Me.Controls("BallsLbl").Caption
Next n
If I comment out the if-then, everything prints in the immediate window.
In the ap, the user can click a label and I turn it vbRed. They can make another choice and I only want to apply it to the textbox next to the label. The labels and the textboxes are unconnected but are named (Textboxes "T1.....TNN", and the labels are named "Bay1.....BayNN"
I would be Thankful, appropriately, for any help.
jpl
Me.Controls("BallsLbl").Caption = 600
Dim n As Integer
For n = 1 To 40
Debug.Print Me.Controls("BallsLbl").Caption
Debug.Print Me.Controls("Bay" & n).BackColor
Debug.Print Me.Controls("T" & n).Value
If Me.Controls("Bay" & n).BackColor = vbRed Then
Me.Controls("T" & n).Value = Me.Controls("BallsLbl").Caption
Next n
If I comment out the if-then, everything prints in the immediate window.
In the ap, the user can click a label and I turn it vbRed. They can make another choice and I only want to apply it to the textbox next to the label. The labels and the textboxes are unconnected but are named (Textboxes "T1.....TNN", and the labels are named "Bay1.....BayNN"
I would be Thankful, appropriately, for any help.
jpl