Get Sorting and Grouping info with code.

Rod C

Registered User.
Local time
Today, 19:00
Joined
Dec 19, 2001
Messages
41
When designing a report you can use a “Sorting and Grouping” pop-up to sort and group records.

Does anyone know how to use code to determine what sorting and grouping was used on a report?

I want to put the sorting and grouping information in a text box on the report so report readers will know how the report was put together.
 
You can use the Report grouplevel, controlsource, and sortorder properties to build a sorting/grouping string for a text box.

Reports!MyReport.grouplevel(0).ControlSource

returns the name of first field you sort or group on

Reports!MyReport.grouplevel(1).ControlSource

returns the name of second field you sort or group on

Reports!MyReport.grouplevel(0).SortOrder

returns False for ascending, True for descending.

Hope this helps,
 
Last edited by a moderator:

Users who are viewing this thread

Back
Top Bottom