Create a report in Access

A report prepares data for printing or PDF: price lists, invoices, sales lists. Unlike a form, it shows every record one below the other, grouped and with totals.

In short: set the Record Source and put fields in the Detail section. Sorting and grouping happen only in the Group, Sort, and Total pane, not through the query’s sort order. Totals go as =Sum([Field]) in a group or report footer.

Before you start: Subform and totals queries from level 2.

Try it now

Run shows the report preview: group headers, detail lines and totals as in Print Preview.

Task Create a price list: Record Source Products, ProductName and UnitPrice in the Detail section, sorted by ProductName. The report footer shows the number of products.

Products 18 rows, 6 columns
ProductIDProductNameCategoryIDUnitPriceUnitsInStockDiscontinued
1Blue ballpoint pen11.20121☐
2Highlighter 4-pack13.9076☐
3Hole punch18.50237☐
4Stapler112.9061☐
5Lever arch file12.8076☑
6USB drive 64 GB29.90193☐
7Wireless mouse219.90157☐
8Keyboard234.90216☐
927-inch monitor2229.00129☐
10Headset249.0047☐
11Office chair3189.00135☐
12Desk3349.0046☐
13Mobile pedestal3129.00105☐
14Copy paper A444.5035☐
15Notepad41.90122☐
16Envelopes 100-pack46.9093☐
17Labels47.5075☐
18Laminating pouches411.90211☐

The sections of a report

Sectionappearstypical content
Report headeronce at the starttitle, date
Page headerat the top of every pagecolumn headings
Group headerbefore each groupcategory name
Detailper recordproduct, price
Group footerafter each group=Sum([UnitPrice])
Page footerat the bottom of every pagepage number
Report footeronce at the endgrand total

Totals such as =Sum() work in group and report footers; in the page footer Access shows an error.

Grouping and sorting

The levels sit one below the other: the outermost group at the top, then further groups and sorts. Each group can have a header and a footer section.

Task Products by category: the Record Source is given. Group on Category (with header and footer), within the group sort by UnitPrice descending. The group footer shows the stock value of the category (sum of UnitPrice times UnitsInStock).

Products 18 rows, 6 columns
ProductIDProductNameCategoryIDUnitPriceUnitsInStockDiscontinued
1Blue ballpoint pen11.20121☐
2Highlighter 4-pack13.9076☐
3Hole punch18.50237☐
4Stapler112.9061☐
5Lever arch file12.8076☑
6USB drive 64 GB29.90193☐
7Wireless mouse219.90157☐
8Keyboard234.90216☐
927-inch monitor2229.00129☐
10Headset249.0047☐
11Office chair3189.00135☐
12Desk3349.0046☐
13Mobile pedestal3129.00105☐
14Copy paper A444.5035☐
15Notepad41.90122☐
16Envelopes 100-pack46.9093☐
17Labels47.5075☐
18Laminating pouches411.90211☐
Categories 4 rows, 2 columns
CategoryIDCategory
1Office
2Tech
3Furniture
4Paper

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Access

  1. Select a table or query, Create, Report for a ready-made draft; the Report Wizard asks for fields, groups and sorting.
  2. In Layout or Design view, on the Report Design tab, Group & Sort opens the Group, Sort, and Total pane at the bottom with Add a group and Add a sort.
  3. Under More for a group: with a header section, with a footer section, totals.
  4. Print Preview shows the report as printed; it can also be saved as PDF there.

Common mistakes

The query’s sort order is ignored

A report does not take over the ORDER BY of its Record Source. Sorting works only through Group, Sort, and Total.

A sort above the group

If the sort by price sits above the group on category, Access sorts by price first; each category then appears in many small groups.

A total in the Detail section

=Sum([UnitPrice]) belongs in a footer. The Detail section shows one value per record.

FAQ

Report or exporting a query?

For lists to work on further, exporting a query to Excel is better; for printouts with groups, totals and layout, the report.

How do I count the records?

With =Count(*) in the report or group footer.

Learn next: grouping and totals

Totals per group and overall, running sums.

Grouping and totals

Write to us

Choose language

Select your preferred language