Unlike sorting data within a form, sorting data
within a report isn’t determined by the underlying query. In fact, the
underlying query affects the report’s sort order only when you have not
specified a sort order for the report. Any sort order specified in the
query is completely overwritten by the report’s sort order, which is
determined in the report’s Group, Sort, and Total window (see Figure 1).
The sorting and grouping of a report is affected by what options you
select when you run the Report Wizard. You can use the Group, Sort, and
Total window to add, remove, or modify sorting and grouping options for
a report. Sorting simply affects the order of the records in the
report. Grouping adds group headers and footers to the report.
Add Sorting and Grouping to a Report
Often, you want to add sorting or grouping to a
report. Grouping enables you to add group headers and group footers to
a report, and sorting allows you to designate the sort order within
your groups. To add grouping and sorting, follow these five steps:
1. | Click
Group & Sort in the Grouping & Totals group on the Design tab
of the Ribbon to open the Group, Sort, & Total window.
|
2. | Select Add a Group to add a grouping to the report, or select Add a Sort to add an additional sorting level to the report.
|
3. | Select the field on which you want to sort or group (see Figure 2).
|
4. | Click and drag the group or sort level until it appears in the appropriate position in the Group, Sort, and Total window.
|
5. | Set the properties to determine the nature of the sorting or grouping . Close the Group, Sort, and Total window, if desired.
|
To remove a sorting or grouping that you have added,
you click the X for the appropriate field in the Group, Sort, and Total
window that you want to delete. Access warns you that any controls in
the group header or footer will be lost.