[ Team LiB ] Previous Section Next Section

Adding Records with a Query

You can use a query to add records to a table by creating an append query. If the fields you've selected have the same name in both tables, Access automatically fills the matching name in the Append To row in the design grid. If the fields in the two tables don't have the same name, enter the names of the fields in the Append To row in the design grid. If the table you are appending records to includes a primary key field, the records you are appending must have the same field or an equivalent field of the same data type. Access won't append any of the records if either duplicate or empty values would appear in the primary key field.

Add Records with a Query

graphics/1_icon.jpg

In Query Design view, create a select query.

graphics/2_icon.jpg

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

graphics/3_icon.jpg

Type the name of the table to which you want to append the records, or click the list arrow, and then choose one.

graphics/4_icon.jpg

Click the Current Database option, or click Another Database and type the name of another database (including the path, if necessary).

graphics/5_icon.jpg

Click OK.

graphics/6_icon.jpg

Specify which fields will contain the appended values by entering the field names in the Append To row of the design grid.

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 append records to the table.

graphics/9_icon.jpg

Open the table to view the appended records.

graphics/06inf19.jpg

    [ Team LiB ] Previous Section Next Section