MS Access

Modifying a Query

Selecting a field in Query Design view.
Moving a field in query mode.

As with any database object, you can modify any existing query. This lesson explains how to add and remove a field from a query and how to rearrange the fields in a query.

  1. Click the Design button in the Database window.

    The London Query appears in Design view. Here's how to remove a field from a query:

  2. Position the mouse over the top of the City field ( changes to ) and click to select the entire field, as shown in figure.

    Once you have selected a field, you can delete it.

  3. Press Delete to delete the selected City field from the query.

    Now let's add a new field to the query.

  4. Double-click the Region field in the Employees field list.

    Access adds the Region field to the design grid. Now let's add some criteria to the new field so that only employees from Washington are displayed.

  5. Click the Region column's Criteria row and type WA.

    You can also rearrange the order of field names in a query. Here's how:

  6. Select the FirstName field, then click and drag the selected field in front of the LastName field, as shown in figure.

    Let's see the results of the modified query.

  7. Click the Run button on the toolbar to view the results of the query. Close the query without saving any changes.

TO ADD A FIELD TO A QUERY:

  • IN THE FIELD LIST, DOUBLE-CLICK EACH FIELD YOU WANT TO INCLUDE IN THE QUERY.

    OR...

  • DRAG THE FIELD FROM THE FIELD LIST ONTO THE DESIGN GRID.

TO DELETE A QUERY FIELD:

  • CLICK THE TOP OF THE FIELD YOU WANT TO DELETE AND PRESS DELETE.

TO REARRANGE FIELDS:

  • POSITION THE POINTER OVER THE FIELD AND THEN CLICK AND DRAG THE FIELD TO A NEW LOCATION.

by BrainBellupdated
Advertisement: