Datasheet
Figure 1-22 The results of the query will be
all records that match the criteria.
Querying multiple tables
This section explores how you can perform a query on multiple tables.
Remember that you split the data into separate tables. You used Relationships
to define the logical relationships between the data. Now you will query from
the tables, based on the relationships that were established.
Suppose you want to see the customer transactions from Colorado. A quick
examination of the TransactionMaster reveals that there is no State field on
which you can filter. However, you see that there is a CustomerNumber field.
In your Access relationships, you defined a one-to-many relationship between
the CustomerNumber primary key in CustomerMaster and the Customer-
Number foreign key in TransactionMaster. Another way to think of it is filter-
ing the TransactionMaster indirectly by filtering a table that is related to it and
using those results to determine which TransactionMaster records to return.
In the query that you already have open, add the TransactionMaster table so
you can add some fields from that table to your query output. Two methods
exist for adding a table to a query, which have already been created. The first
method is to right-click the top half of the QBD (Query By Design) and select
Add Table. The second method is to select the Add Table button in the toolbar.
Either way, you will bring up the Add Table dialog box.
Access Basics 31
05_59978X ch01.qxp 12/1/05 7:46 PM Page 31