Blog# 23 : Understanding Delete Query

Here in this blog post, lets understand the “Delete Query“. Delete Query is used to delete a record or set of records (for a given Criteria) or entire records from the underlying table.

Let’s consider the table “Post_Office_Table” which we created using the Make Table Query in the previous Blog to understand the delete Query, the table has 154797 records and that we want to delete the entire records from the table.

The following process needs to be followed the entire records from the table:

  • Open MS Access and open the database Learning Access.
  • Create a new Query using the Design Mode.
  • Add the table “Post_Office_Table” to the right pane of the query design area.
  • Add all the columns to the right bottom grid of the Query pane.
  • Change the Query type to “Delete“.
  • Save the Query with the name “Delete_Query1“.
  • Click on “Run” to execute the Query.
  • Click in “Yes” to Confirm execution of the Query.
  • The Query is executed and all the records in the underlying table are deleted.
  • Open the Table “Post_Office_Table” to see the results. The records would have been deleted.

Pasted below is the Video demonstrating the same.

Delete Query1 Video

Delete Query2

Note – As an exercise, modify the query to delete records that has a value “NA” in the column “Related Suboffice” in the table “Post_Office_Table“. Delete Query2 Video demonstrates two methods to pass the criteria for deleting records that match the criteria “NA“.

Query with Criteria 

Dynamic Query to pass criteria at Run Time

 

 

 

Leave a comment