Microsoft Office Tutorials and References
In Depth Information
To create, run, and save the query using the Employer and Position tables:
1. Click Queries in the Objects bar of the Database window, and then double-click Create query
in Design view . The Show Table dialog box opens on top of the Query window in Design view.
You need to add the Employer and Position tables to the Query window.
2. Click Employer in the Tables list box (if necessary), click the Add button, click Position ,
click the Add button, and then click the Close button. The Employer and Position field lists
appear in the Query window, and the Show Table dialog box closes. Note that the one-to-
many relationship between the two tables is shown in the Query window. Also, notice that
the join line is thick at both ends; this signifies that you selected the option to enforce refer-
ential integrity. If you had not selected this option, the join line would be thin at both ends
and neither the “1” nor the infinity symbol would appear, even though there is a one-to-
many relationship between the two tables.
You need to place the EmployerName, City, and StateProv fields from the Employer field
list into the design grid, and then place the Openings, PositionTitle, StartDate, and
EndDate fields from the Position field list into the design grid. This is the order in which
Matt wants to view the fields in the query results.
3. Double-click EmployerName in the Employer field list to place EmployerName in the
design grid’s first column Field text box.
4. Repeat Step 3 to add the City and StateProv fields from the Employer table, so that these
fields are placed in the second and third columns of the design grid.
5. Repeat Step 3 to add the Openings , PositionTitle , StartDate , and EndDate fields (in that
order) from the Position table, so that these fields are placed in the fourth through seventh
columns of the design grid.
The query specifications are completed, so you can now run the query.
6. Click the Run button on the Query Design toolbar. Access runs the query and displays
the results in the datasheet.
7. Click the Maximize button
on the Query window title bar. See Figure 3-11.
Datasheet for the query based on the Employer and Position tables
fields from Employer table
fields from Position table
Only the seven selected fields from the Employer and Position tables appear in the
datasheet. The records are displayed in order according to the values in the primary key
field, EmployerID, even though this field is not included in the query datasheet.
Matt plans on frequently tracking the data retrieved by the query, so he asks you to save
the query as “EmployerPositions.”