A good way to Group Controls?

  • Thread starter Thread starter halfbodyguy
  • Start date Start date
H

halfbodyguy

I am wondering if there is an effective way to have a list of controls
that can be grouped into 1 name. Simply, I have lots of buttons that
affect the behavior of the same group of controls, and it would be nice
to be able to do something along the lines of:

If >1 then CONTROLGROUP.Enabled=False Else CONTROLGROUP.Enabled=True


Any Ideas if there is an easier way than all the redundancy of calling
each control each time?
 
I am wondering if there is an effective way to have a list of controls
that can be grouped into 1 name. Simply, I have lots of buttons that
affect the behavior of the same group of controls, and it would be
nice to be able to do something along the lines of:

If >1 then CONTROLGROUP.Enabled=False Else CONTROLGROUP.Enabled=True


Any Ideas if there is an easier way than all the redundancy of calling
each control each time?

I generally use the control's Tag property to mark a control as
belonging to a particular group. Then I can loop through all controls
and act only on those that have a particular value in the Tag property,
like this:

Dim ctl As Access.Control

For Each ctl In Me.Controls

If ctl.Tag = "Group1" Then
ctl.Enabled = blnEnableOrDisable
End If
Next ctl
 
Back
Top