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
| ProductID | ProductName | CategoryID | UnitPrice | UnitsInStock | Discontinued |
|---|---|---|---|---|---|
| 1 | Blue ballpoint pen | 1 | 1.20 | 121 | ☐ |
| 2 | Highlighter 4-pack | 1 | 3.90 | 76 | ☐ |
| 3 | Hole punch | 1 | 8.50 | 237 | ☐ |
| 4 | Stapler | 1 | 12.90 | 61 | ☐ |
| 5 | Lever arch file | 1 | 2.80 | 76 | ☑ |
| 6 | USB drive 64 GB | 2 | 9.90 | 193 | ☐ |
| 7 | Wireless mouse | 2 | 19.90 | 157 | ☐ |
| 8 | Keyboard | 2 | 34.90 | 216 | ☐ |
| 9 | 27-inch monitor | 2 | 229.00 | 129 | ☐ |
| 10 | Headset | 2 | 49.00 | 47 | ☐ |
| 11 | Office chair | 3 | 189.00 | 135 | ☐ |
| 12 | Desk | 3 | 349.00 | 46 | ☐ |
| 13 | Mobile pedestal | 3 | 129.00 | 105 | ☐ |
| 14 | Copy paper A4 | 4 | 4.50 | 35 | ☐ |
| 15 | Notepad | 4 | 1.90 | 122 | ☐ |
| 16 | Envelopes 100-pack | 4 | 6.90 | 93 | ☐ |
| 17 | Labels | 4 | 7.50 | 75 | ☐ |
| 18 | Laminating pouches | 4 | 11.90 | 211 | ☐ |
The sections of a report
| Section | appears | typical content |
|---|---|---|
| Report header | once at the start | title, date |
| Page header | at the top of every page | column headings |
| Group header | before each group | category name |
| Detail | per record | product, price |
| Group footer | after each group | =Sum([UnitPrice]) |
| Page footer | at the bottom of every page | page number |
| Report footer | once at the end | grand 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
| ProductID | ProductName | CategoryID | UnitPrice | UnitsInStock | Discontinued |
|---|---|---|---|---|---|
| 1 | Blue ballpoint pen | 1 | 1.20 | 121 | ☐ |
| 2 | Highlighter 4-pack | 1 | 3.90 | 76 | ☐ |
| 3 | Hole punch | 1 | 8.50 | 237 | ☐ |
| 4 | Stapler | 1 | 12.90 | 61 | ☐ |
| 5 | Lever arch file | 1 | 2.80 | 76 | ☑ |
| 6 | USB drive 64 GB | 2 | 9.90 | 193 | ☐ |
| 7 | Wireless mouse | 2 | 19.90 | 157 | ☐ |
| 8 | Keyboard | 2 | 34.90 | 216 | ☐ |
| 9 | 27-inch monitor | 2 | 229.00 | 129 | ☐ |
| 10 | Headset | 2 | 49.00 | 47 | ☐ |
| 11 | Office chair | 3 | 189.00 | 135 | ☐ |
| 12 | Desk | 3 | 349.00 | 46 | ☐ |
| 13 | Mobile pedestal | 3 | 129.00 | 105 | ☐ |
| 14 | Copy paper A4 | 4 | 4.50 | 35 | ☐ |
| 15 | Notepad | 4 | 1.90 | 122 | ☐ |
| 16 | Envelopes 100-pack | 4 | 6.90 | 93 | ☐ |
| 17 | Labels | 4 | 7.50 | 75 | ☐ |
| 18 | Laminating pouches | 4 | 11.90 | 211 | ☐ |
Categories 4 rows, 2 columns
| CategoryID | Category |
|---|---|
| 1 | Office |
| 2 | Tech |
| 3 | Furniture |
| 4 | Paper |
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
- Select a table or query, Create, Report for a ready-made draft; the Report Wizard asks for fields, groups and sorting.
- 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.
- Under More for a group: with a header section, with a footer section, totals.
- 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.