grouping (1 Viewer)

skate

Registered User.
Local time
Today, 03:57
Joined
May 22, 2002
Messages
136
Is it possible to group a list of items so that I can write
If xx = true then
group1.visible=true
end if
 

Drevlin

Data Demon
Local time
Today, 03:57
Joined
Jul 16, 2002
Messages
135
If your talking items on a form then you could use a Microsoft Forms 2.0 frame to create your form and then all you'd need to do is hide the frame. But I think that would get really annoying... especially if you'd already built your form.

What I would do is to create a collection and then fill it with the items. Then just walk through the collection with a "for.. Each"

Like this:

Option Compare Database
Private colFormItems As New Collection

Private Sub Form_Load()
colFormItems.Add Me.Combo0
colFormItems.Add Me.Text5
colFormItems.Add Me.List2
End Sub

Private Sub ifTrueHide(blnVar as Boolean)
Dim obj as Object

If blnVar = True Then
For Each obj In colFormItems
obj.Visible = True
Next
End if

End Sub
 

skate

Registered User.
Local time
Today, 03:57
Joined
May 22, 2002
Messages
136
basically I just have a bunch of labels and text boxes in a report and I want to make them invisible given a return value of "yes". And to avoid typing every single item i was hoping to find an easier way to do it using, perhaps a loop? (Label1, Label2, Label3.....x=1 to 3....)
 

Users who are viewing this thread

Top Bottom