Form Groups??

spinkung

Registered User.
Local time
Today, 23:08
Joined
Dec 4, 2006
Messages
267
Hi All,

Can anyone tell me if it's possble to hide entire form groups from VBA.

I have several controls on a form which i have grouped. I want to be able to use something like : form.group.visible = false/true

Otherwise i'll have to do each control which is a bit of a time burner.

Many Thanks.
 
You can use control tags to do this ...

For instance in one group of controls name the tag 'Group1' and another 'Group2' then loop through the controls, evaluate the tag and set the visibility to False.

Code:
    Dim ctl As Control
 
    For Each ctl In Me.Controls
           If ctl.Tag = "Group1" Then
              ctl.Visible = False
           ElseIf ctl.Tag = "Group2" Then
              ctl.Visible = False
           End If
        End Select
    Next

I think I have that right ...
-dK
 
spot on. Thankyou. :)
 

Users who are viewing this thread

Back
Top Bottom