An Append query takes a group of records from one or more tables or queries in your database and adds them to another table. Append queries are especially useful for importing information into a table. There are several rules that you must follow when using an append query:
- The appended data must meet the data validation and referential integrity rules of the table to which it is being added.
- The appended data must have its own unique primary-key values. If the primary-key field in the table to which the data is being added is an AutoNumber field, do not append that field— Access will generate new numbers for the new records.
- The type of data in the records you're adding must match the type of data in the table to which you're adding them.
- Click the Create tab on the ribbon.
- Click the Query Design button.
The Query Design window and Show Table dialog box both appear. Here you should select the tables and/or queries containing the data you want to append to another table.
- Select the tables and queries you want to add and click Add.
- Click Close.
Now you need to make the query an Append query.
- Click the Append button.
The Append dialog box appears. Here you need to select the table to which you want the results of the query to be added. First, though, you need to select the database where the table is located. You have two options:
- Current Database: If the table is in the currently open database.
- Another Database: Browse other databases.
- Select the Current Database or Another Database option.
Now select the table.
- Click the Table Name list arrow and select the table.
- Click the OK.
The Append query will add the results of its query to the table you just specified. Notice that an Append To row appears in the design grid. Now you need to specify the fields you want to append.
- Add the fields you want to append to another table.
If the field(s) you added are present in the destination table, Access automatically fills in the Append To row. If the field is not present in both tables, you will have to select the name of the field to which you want to append.
- If Access doesn't automatically match a field, click the Append To row for that field and select the field to which you want to append.
As with any action query, you should always preview the results in Datasheet View first.
- Click the View button to preview the query.
The Append query displays the records it will add or append.
- Click the View button to display the query in Design View.
Now run the append query to append the records.
- Click the Run button on the ribbon.
Access asks you to confirm the addition of the records to the table.
- Click Yes.
Access adds the records.