Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Unanswered: Grouping controls together

    Hi,
    is it possible to group together several controls on a form?
    For example if I need to make several controls Visible or Invisible on an event I need to individually set their visible property to False , how ever if I have a group I can set their properties all at once, kind of like the Option group frame.

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    I've had this prob before.

    The only way I could think of was to do it by name:

    for each ctl in me.form
    if ctl.name like "group1*" then
    ctl.enabled = false
    next ctl

    the code's not exact but you get the idea.

  3. #3
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164
    I found another way,
    You can use Tags.
    This was posted on anoter forum by GHolden:

    Dim ctl As Control
    Dim intCount As Integer

    For Each ctl In Me.Controls
    If ctl.ControlType = acLabel And ctl.Tag = "1" Then
    ctl.ForeColor = vbYellow
    End If
    Next ctl


    http://www.tek-tips.com/viewthread.c...2806&tmac=logc

  4. #4
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    Good idea. I've always thought tags were pointless. At last a use. Anyone else ever found a use for them?
    J.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •