Ms access updating and viewing record

Rated 4.28/5 based on 639 customer reviews

Open tbl Albums Updated, and you’ll see that many of the purchase prices for the same albums have been entered (see Figure 1-16).

Now run the qry Update Album Prices query found in the same database (see Figure 1-17).

Is there any way—short of using a complex VBA procedure—to update the price data in the existing table based on the updated prices from the imported table without overwriting any of the other fields in the existing table?

You probably already know that you can use an update query to update the values of fields in a table, but did you know that you can use an update query to update the values in one table with the values from another? If you can join the two tables on some common field or combination of fields, you can use an update query to update a field in one table based on the values found in a second table.

You can update more than one field at a time in an update query.

You can also include additional fields in the query grid to further limit the rows to be updated.

Drag these additional fields to the query grid and specify criteria for them.

This row also contains an asterisk (*) in the row selector box at its left end. When you add records to a table in datasheet view in Access, each new record is added to the bottom of the table in the “New Record” row.This action query will take the Purchase Price values from tbl Albums Updated and copy it into the Purchase Price field in tbl Albums for each record where the two Album ID fields match and the price value in tbl Albums is currently null.When the query is finished, open tbl Albums again—you should see that the Purchase Price field in this table has been updated based on the values in tbl Albums Updated (see Figure 1-18).You cannot use an update query to add new records to a database, or to delete records from a database.To add new records to a database you use an append query, and to delete whole records from a database you use a delete query.

Leave a Reply