Part I: Access Building Blocks
324
Tip
Very often, an Access report is expected to duplicate an existing paper report or form used by the application’s
consumers.
Assembling the data
After you have a general idea of the report layout, assemble the data needed for the report. Access
reports use data from two primary sources:
l (^) A single database table
l A recordset produced by the query
You can join many tables in a query and use the query’s recordset as the record source for your
report. A query’s recordset appears to an Access report as if it were a single table.
As you learned in Chapter 4, you use queries to specify the fields, records, and sort order of the
records stored in tables. Access treats a recordset data as if it were a single table (for processing
purposes) in datasheets, forms, and reports. When the report is run, Access matches data from the
recordset or table against the fields specified in the report and uses the data available at that
moment to produce the report.
Note
Reports do not follow the sort order specified in an underlying query. Most often reports are sorted at the
report level, either in the detail section or in a group section. Very often, it’s a waste of time to sort data in a
query that is used solely to populate a report because the data is resorted and rearranged by the report itself.
In the following example, you use data from tblProducts to create a relatively simple tabular
report.
Creating a report with the Report Wizard
Access enables you to create virtually any type of report. Some reports, however, are easier to cre-
ate than others, especially when a Report Wizard is used as a starting point. Like form wizards, the
Report Wizard gives you a basic layout for your report, which you can then customize.
The Report Wizard simplifies laying out controls by stepping you through a series of questions
about the report that you want to create. In this chapter, you use the Report Wizard to create tabu-
lar and columnar reports.
Creating a new report
The Access ribbon contains several commands for creating new reports for your applications. That
Create tab of the ribbon includes a grouping called Reports containing several options such as
Report, Labels, and Report Wizard. For this exercise, click the Report Wizard button in the
Reports group of the Create ribbon tab. The first screen of the Report Wizard (shown in Figure
9.5) appears.