Kpatel said:
I am aware of this. However, what I was looking for is how can I create a
loop that goes through every section on the report and sets the visibility
property. Something similar to this
Dim ctl as Controls
For Each ctl In Me.Controls
ctl.Visible = False
Next
But I want to be able to do this for every section on the report. Also, I
would like to know what event should I be doing this in.
There is no Sections collection so that kind of thing is not
doable.
Each control in a form/report has a Section property that
tells you which section contains the control. I guess you
could loop through the Controls collection and construct an
array or collection of the section numbers in the
form/report, However, by the time you do all that, you
could just set each section's Visible property with less
code.
The only alternative I can think of is a loop like:
On Error GoTo AllDone
For N = 0 To 23
Me.Section(N).Visible = False
Next N
AllDone: