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.
- 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 −
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.
- 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.
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