Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For without next

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
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

 
Never Mind. Always forget about the end if part.

jpl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top