Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 4: Selecting Data with Queries


135


When using an action query, the query’s recordset is gone when the query ends. Action queries
perform an action on the records specified by the query’s design, but no records are returned to
display on a form or report.

When you save a query, only the structure of the query is saved, not the returned records.
Consider these benefits of not saving the recordset to a physical table:

l A smaller amount of space on a storage device (usually a hard disk) is needed.

l (^) The query uses updated versions of records.
Every time the query is executed, it reads the underlying tables and re-creates the recordset.
Because recordsets themselves are not stored, a query automatically reflects any changes to the
underlying tables made since the last time the query was executed — even in a real-time, multiuser
environment. Depending on your needs, a query’s recordset can be viewed as a datasheet, or in a
form or report. When a form or report is based on a query, the query’s recordset is re-created and
bound to the form or report each time it’s opened.
Creating a Query
After you create your tables and place data in them, you’re ready to work with queries. To begin a
query, choose the Create ribbon, and click on the Query Design button in the Other group. Access
opens the query designer in response.
Figure 4.5 shows two windows. The underlying window is the query designer. Floating on top of
the designer is the Show Table dialog box. The Show Table dialog box is modal, which means that
you must do something in the dialog box before continuing with the query. Before you continue,
you add the tables required for the query. In this case, tblProducts is highlighted and ready to
be added.
FIGURE 4.5
The Show Table dialog box and the query design window

Free download pdf