Chapter 4: Selecting Data with Queries .......................................................................................
131
FIGURE 4.1
A typical three-table select query
After you create and run a query, Microsoft Access retrieves and displays the requested records as a
datasheet. This set of records returned by a query is called a recordset. As you’ve seen in Chapters 1
and 2, a datasheet looks just like a spreadsheet, with rows of records and columns of data. The
Datasheet view of the recordset can display many records simultaneously.
You can easily filter information from a single table using the Search and Filter capabilities of a
table’s Datasheet view (Filter by Selection and Filter by Form).
Cross-Reference
I discuss datasheets in detail in Chapter 6.
Clicking the Datasheet View button on the ribbon runs the query and returns the records shown in
Figure 4.2. This query is relatively easy to design when you understand how to use the Access
query designer. This simple query has many elements that demonstrate the power of the Access
query engine: sorting a result set of records, specifying multiple criteria, and even using a complex
Or condition in one of those fields.
You can build very complex queries using the Access query designer. Suppose, for example, that
you want to send a notice to all previous buyers of multiple products in the past year. This type of
query requires getting information from four tables: tblCustomers, tblSales, tblSalesLi-
neItems, and tblProducts. The majority of the information you need is in tblCustomers
and tblProducts.