[ Team LiB ] Previous Section Next Section

Updating Records with a Query

An update query allows you to make changes to a set of records that match your query's criteria. For example, if you want to increase the unit price of board games in a toy product table by $3, you can construct a query that will locate those records and update them to the new value. Make sure you preview the changes to the records before you run the query, because once the records are changed you can't easily change them back.

Create a Query to Update Records

graphics/1_icon.jpg

Display a new query in Query Design view. Add the fields or fields you intend to update and any fields that you want to use for the selection criteria.

graphics/2_icon.jpg

Click the Query Type button list arrow on the Query Design toolbar, and then click Update Query.

graphics/3_icon.jpg

Enter an expression to update the selected field.

graphics/4_icon.jpg

Enter a criterion, if needed, to indicate which records should be updated.

graphics/5_icon.jpg

Click the Datasheet View button on the Query Design toolbar.

graphics/6_icon.jpg

If you're satisfied that the appropriate records would be updated, click the Design View button to return to Query Design view.

graphics/7_icon.jpg

Click the Run button on the Query Design toolbar.

graphics/8_icon.jpg

Click Yes when Access asks if you're sure you want to update the records.

graphics/9_icon.jpg

Open the table to view the remaining records.

graphics/06inf21.jpg

    [ Team LiB ] Previous Section Next Section