Kill a GroupLevel in OpenEvent

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I'm still working on making a report that automatically formats
itself. I pre-defined a report with three group levels, and can change
their control sources as needed.
What do I do when a user wants a report with only two group levels?
How do I make the third group level go away? In design view, I'd clear the
line in the sorting and grouping box. What do I do in VB to accomplish
this?
 
Just set the ControlSource for the inner group level to the same field as
the middle group level. If desired, you can also turn off the Visible
property for the group header or footer.

This gets around the limitation that you can't create/destroy group levels
in an mde or runtime Access.
 
Allen,

I have a similiar problem, except I'm using one of the
group footers as a "summary" for totals, averages, etc. I
want the user to be able to have the option (based on a
previously input variable) to print the entire report or
just the summary. (The detail section of the report comes
from a subreport). However, when I try to hide the detail
section, all of the footer sections totals are zero. Any
ideas.

Thanks,
April
 
Haven't tried that April. It may be that if the detail section contains the
subreport, and the section is not printed that Access does not go through
the process of preparing the subreport.

Once workaround would be to move the subreport data into the main report's
RecordSource query so you don't need the subreport. Another alternative
might be to set the Height of the detail section to 0.1 inch and turn of
GanGrow in Report_Open instead of hiding it completely. A third alternative
would be to use DSum() or similar to get the results so the main report is
not dependant on the subreport to supply its values.
 
Just set the ControlSource for the inner group level to the same field
as the middle group level. If desired, you can also turn off the
Visible property for the group header or footer.

This gets around the limitation that you can't create/destroy group
levels in an mde or runtime Access.

Hi Allen,
Thanks for the advice. Setting the inner group the same as the outer
group solved part of it. I'm having trouble setting the header and footer
visibility. I don't seem to be able to get to them from VB. Any tricks?
 
Hi Allen,
Thanks for the advice. Setting the inner group the same as
the outer
group solved part of it. I'm having trouble setting the header and
footer visibility. I don't seem to be able to get to them from VB.
Any tricks?


Hi Again,
It occurred to me that if I set the sections and controls able to
shrink, and set the control source of the controls to "", they all vanish
nicely.
If you know a trick to get to the Visible property of the headers and
footers, I'd still like to learn it. My problems (for now) are solved
though.
 
Max said:
Hi Allen,
Thanks for the advice. Setting the inner group the same as the outer
group solved part of it. I'm having trouble setting the header and footer
visibility. I don't seem to be able to get to them from VB. Any tricks?

Just set the section's Visible property to False:

Me.Section(9).Visible = False
Me.Section(10).Visible = False
or, if the name of the header section is GroupHeader2,
Me.GroupHeader4.Visible = False
Me.GroupFooter5.Visible = False
 
Marsh is right: even though the Intellisense doesn't show a Visible property
for some controls etc, it does work.
 
Back
Top