Report Grouping

G

Guest

Hi,
I have a form that asks the user what:
Fields they want displayed on the report
How they want the fields sorted.

information from the form is passed to the report on open.
This works fine.
The problem is:
I wish to add grouping levels on the open of the report also as specified by
the user.
I only know how to do this manually by going into the Report design, right
clicking, and clicking sorting and grouping.
any help with this code will be really appreciated.

Kind Regards

Neil
 
M

Marshall Barton

neshev said:
I have a form that asks the user what:
Fields they want displayed on the report
How they want the fields sorted.

information from the form is passed to the report on open.
This works fine.
The problem is:
I wish to add grouping levels on the open of the report also as specified by
the user.
I only know how to do this manually by going into the Report design, right
clicking, and clicking sorting and grouping.
any help with this code will be really appreciated.


You can not create group levels in a running report.
However if you precreate as many levels as you might need,
you can set their ControlSource property in the report's
Open event.

Me.GroupLevel(0).ControlSource = strFieldName

If you want to "disable" a group level, then set it control
source to a constant expression and make the group header
and/or footer invisible:

Me.GroupLevel(1).ControlSource = "=1"
Me.Section(7).VIsible = False '2nd level header
Me.Section(8).VIsible = False '2nd level footer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top