Microsoft Office Tutorials and References
In Depth Information
Changing Data with Update Queries
More-complex updates include expressions that tell Access exactly
how to update the field. To increase the Selling Price field in a
table by 10 percent, for example, you use the expression [Selling
Price]*1.10. You can use the Expression Builder to help build an
expression for the Update To row; just click the box and then click the
Build button. (See Chapter 2 of this minibook for more information on
using Expression Builder to create expressions.)
If you created a test field in Step 5, move the expression to the Update
To row for the field that will be updated, and delete the field you created
to test the expression. Note that you move the expression that appears
after the colon in the test field. You don’t need to include a field name
and a colon in the Update To row.
Figure 3-3 shows the update query that finds all orders for the Golden
Whistle and changes them to orders for the New Golden Whistle (which
has a ProductID of 19).
ID of 2
8. Click the View button.
Access displays the datasheet with the records that the query changes
when you run it. If the records aren’t the ones that you want updated,
return to Design view to correct the fields and criteria. This data is the
same data that you displayed in Step 5; display it again to make sure
you’re making the changes you want to make. Check Design view
carefully to make sure that the Update To row is correct.