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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enabling/disabling checkboxes via loop

Status
Not open for further replies.

shawndu

Programmer
Nov 20, 2001
5
CA
I want to be able to loop through a specific number of checkboxes and disable them. The following is something i've tried and I just can't get it to work! The string check_box isn't being recognized.

Private Sub time_loop()
Dim Counter
Dim check_box As String

Counter = 1
While Counter < 20
check_box = &quot;Check&quot; & Str(Counter)
Counter = Counter + 1
check_box.Enabled = False
Wend

End Sub

If it's just not possible to do this please let me know so I can rethink my strategy and move on!
 
Hi!

Instead of check_box.enabled use Me.Controls(check_box).Enabled

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top