Microsoft Office Tutorials and References
In Depth Information
Taking Tips on Creating a Query
Adding tables to the query
To use a table’s fields in a query, you have to add the table name to the top
pane of the Design view. To do that, you need to view all table names by
opening the Show Table dialog box in either of the following ways:
✦ Right-click the Table pane of Design view and then choose Show Table
from the contextual menu.
✦ Click the Show Table button in the Query Setup group on the Design tab
of the Ribbon.
After the Show Table dialog box opens, add a table to the query by using
whichever of the following methods is more convenient:
✦ Double-click the table name in the Show Table dialog box.
✦ Select the table and then click the Add button.
After you add all the tables that you need, click the Close button in the Show
Table dialog box to get back to work in Design view.
To remove a table from a query, just press Delete (on your keyboard) when
the table in the Table pane is selected (that is, when any field in the table is
highlighted). When a table is deleted from Design view, all the fields in the
design grid from that table are deleted too. Because deleting a table from a
query is so absurdly easy — and can have damaging consequences for your
query — take care when your fingers get close to the Delete key. Also, save
your query design often so that you can easily restore a saved version if you
accidentally delete something important.
If you want to include a field generated by another query, you can add
queries to a query by clicking the Queries tab or the Both tab of the Show Table
dialog box and then double-clicking the query name.
Inserting fields into a design grid
You can move a single field from the Table pane to the design grid in any of
three easy ways:
✦ Double-click the field name. Access moves the field to the first open
column in the grid.
✦ Drag the field name from the Table pane to the Field row of an unused
column in the design grid. This option is popular among dragging fans
and for putting a field in a specific location in the grid.
✦ From the drop-down menu in the Field row of the design grid, choose
the field you want. If you use this method with a multiple-table query,
you may find it easier to choose the table name from the Table
dropdown menu before selecting the field name. If you don’t have the Table
row in your design grid, see “Displaying or hiding table names,” earlier
in this chapter.