How do you add records to a table using an append query?

This article addresses the importance of Append Query and the proper way of creating them in MS Access.

In MS Access and all the other database management systems, queries act like the pillar of the software, which can perform various actions to make your database more organized and operational. These queries come in handy for working on different types of tasks, like for retrieving, updating, editing or deleting, or creating a new table in the database.

How do you add records to a table using an append query?

  • Action queries can be used for adding, changing, or deleting multiple records from a Table, record or field at one time.
  • The added benefit of Action query is that user can preview their query results in MS Access before even running it.
  • Microsoft Access offers the following types of Action Queries −
  • Append
  • Update
  • Delete
  • Make-table

Note that users cannot undo an action query. So, they should consider creating a backup of the data that they are planning on updating using the query.

Steps for creating an Append Query

Append query is a form of (SQL statement) action query which allows users to insert records in a Table. Append query is also referred to Insert query as it uses INSERT INTO command as its SQL syntax. Users can use Append Query for adding new tables or data to another table. It can also be used for retrieving data from multiple Tables.

Let’s take an example of a table name EmployeeId and EmployeeSalary to make this procedure more clear.

  • Step 1: Open the Table in which you wish to make the necessary changes.
  • Step 2: Go to Show Table dialog box, select Table Tab and select the Employee Table.
  • Step 3: Now open the field that you want to display.

Users can run their query before using the Append Query to ensure where they want to make the necessary changes.

  • How do you add records to a table using an append query?
    Step 4: Go to Query Design and click on the Append button.
  • Step 5: Now the user needs to specify the query type in option button as Append in the open Wizard. The Append Query Wizard will appear on the screen.
  • Step 6: Now user needs to select the table in which they want to use the query using the drop-down list. (EmployeeSalary Table)
  • Step 7: Note that in case the field selected by the user does not exist in the Table, it won’t be displayed on the screen. This might even cause problems for the query to run properly. So if the user selects EmployeeID 5 and his salary is not given in the EmployeeSalary table, the user won’t be able to properly run the code. Here we are using Append Query to add a Field in the EmployeeSalary Table field 5.
  • Step 8: Now the user can add the field in the table using the Append query.
  • Step 9: Once the user has made the necessary changes, he can run the query. A confirmation message will appear on the screen to notify the user whether it is running properly or not. Select yes for confirming your action.
  • Step 10: Now open the Employee Table again, and the user will be able to see all the additional inserted data which have been added on the screen from EmployeeID and EmployeeSalary.

In case you ever encounter an Access crash; do not hesitate from calling in a specialized accdb recovery tool. It can be the only thing saving you from the hassles of data loss.

Author Introduction:

Vivian Stevens is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and excel recovery software products. For more information visit www.datanumen.com

26

Creating Append Queries

Append queries are Action Queries used to add a row, or multiple rows, of data to a table as new records. The records can originate in a single table, multiple tables, from values pulled from a form, or from hardcoded values in the query. Append queries are one of many methods used to add records to a table:

  • Add records to the table using form controls bound to the table.
  • Add records from a table or tables using an Append query.
  • Add single records using a single-record Append query.
  • Add records using macros or VBA code.

Learning how to use Append queries should make your database perform better. In this lesson, you learn how to create and use both types of Append queries available in Access 2010, and use Query Design View and SQL View to design your query.

LESSON SETUP

For this lesson you need Access 2010 and the Lesson 26 files from the book's website at www.wrox.com. You should be familiar with creating database objects and working with queries to successfully complete this lesson.

APPEND QUERIES IN ACCESS

Access 2010 has two types of Append queries: the multi-record Append query and the single-record Append query. The multi-record Append query uses records that originated from pre-existing tables available to the database. A single-record Append query will get its values from fields that are either literal values or calculated values. Remember that when inserting values into a table that uses an AutoNumber primary key, you will need to be certain ...

How does an append query work in access?

Append Queries are very powerful and lets you combine data from multiple tables and/or queries, specify criteria and put them into fields of an existing table. Think of it as a SELECT query where you can save the results in a table. The field names of the source and target tables do not need to match.

What does table append mean?

Appending tables combines records from two or more Analytics tables into a new table. You may need to append multiple tables into a single table before you can perform analysis. For example, you want to perform analysis on an entire year's worth of data but the data is spread among twelve monthly Excel worksheets.