Home About us Development Training Hints and Tips This page in plain text |
Types of query in AccessYou have probably used Select Queries in Access to select information from your database. Other types of query let you modify or delete records. These are listed on the Query Type toolbar button:
This button appears whenever the Query Design window is active on screen. If you click the arrow on the right of this button, a list will drop down to show the types of query available:
The button always defaults to When you run the query, Access will warn you that a number of records are about to be updated. If you click then Access will update the fields in these records. There is no way of undoing the changes once you have clicked .Delete queryA Delete Query is simpler than an Update Query. The only change that you'll notice in the Query Designer when you select is that the and rows will disappear.When you run the query, Access will warn you that a number of records are about to be deleted. If you click then Access will delete these records. There is no way of retrieving the records that have been deleted.WarningBoth the Update and Delete queries will show a message telling you how many records are going to be affected and warning you that you will not be able to undo this change. This is a serious warning. These two types of query can destroy a lot of data very quickly. A good way of working with these types of queries is to start by creating an ordinary Select Query. Set the criteria to pick the records that you want to alter or delete then run this query and check that it has indeed picked the records that you intended. Make a note of the number of records it selects. When you are happy that the Select Query is picking the correct records, click the toolbar button and convert the query into an Update or Delete query. Run this query and check that the warning message gives the correct number of records. This will confirm that you are affecting the records that you wanted to. |