Referencing Toggle Buttons in a loop

  • Thread starter Eddie's Bakery and Cafe'
  • Start date
E

Eddie's Bakery and Cafe'

I have a situation where I need to reference multiple toggle buttons by
reference. I need to create a loop where each toggle button object is
individual controlled. For example, the following pseudo-code demonstrates
my intent:

While (togglebuttone_object <> Null)
ToggleButtonObject.Caption = “Some Valueâ€
ToggleButtonObject = Next ToggleButtonObject
Wend

Your suggestions are greatly appreciated

Thanks,

Eddie
 
D

Douglas J. Steele

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is ToggleButton
ctlCurr.Caption = ...
End If
Next ctlCurr

Of course, if you've only got a few, it's probably easier to simply refer to
them by name.
 
E

Eddie's Bakery and Cafe'

Thanks Douglas,

I will give this a try

Douglas J. Steele said:
Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is ToggleButton
ctlCurr.Caption = ...
End If
Next ctlCurr

Of course, if you've only got a few, it's probably easier to simply refer to
them by name.
 
Top