• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 10. Reports > Begin the Report by Creating a Query

Begin the Report by Creating a Query

Usually you'll want to create a report from a query that pulls together data from two or more tables as your record source. You'll create a query that combines key fields from tblCountries, such as area and population, with fields from the other tables that will display the government type and historical legacy.

If your Relationships window is still open, close it.

In the Database window, click Queries. Double-click Create Query in Design View.

In the Show Table dialog box, add tblGovernment, tblCountries, and tblHistory (in that order) to the query. Close the Show Table dialog box.

If necessary, maximize the design window. From the Countries field list, double-click the Country, Area, and Population fields to add them to the grid.

From the Government field list, add GovtType to the grid. From the History list, add HistRule (see Figure 10.3).

Figure 10.3. The query in Design view.

Click the View button at the far left of the toolbar to switch to Print Preview view and view your records.

Choose File, Save and save the query as qryAdministration.

Close the query.

NOTE The source of a report doesn't have to be a query. For example, you can create an AutoReport, a simple columnar listing of all fields and field values in a table, by selecting the table in the Database window and choosing Insert, AutoReport. In that case, the source for the records is the table itself. But because the power of a relational database is manifest in bringing together data from different tables, queries are a much richer and more pertinent example.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint