Microsoft Office Tutorials and References
In Depth Information
Chapter 3: Doing Neat Things with Action Queries and Query Wizards
You also need to be careful about how you open an action query. Action
queries are always rarin’ to go. When you open an action query from the
Navigation Pane by double-clicking the query name or by selecting it and
clicking the Open button, you tell Access to run the query, not just to show
it. Access does at least warn you that you’re about to run an action query by
telling you You are about to run a query that will modify data
in your table. If you don’t want to run the action query, click No to
cancel it. If all you want to do is work on the design, be sure to right-click the
query name in the Navigation Pane and choose Design view from the
Action queries have exclamation points next to their names in the
Navigation Pane, making them easy to spot.
You may see an error message when you try to run an action query. By
default, Access disables all action queries unless your database resides in a
trusted location or unless the database itself is signed and trusted.
Settings for action queries are in the Trust Center, which you access by
clicking the File tab on the Ribbon and choosing File ➪ Options ➪ Trust Center.
Click the Trust Center Settings button to display the Trust Center options.
Action queries are affected by the ActiveX options. The Trust Center is
covered more extensively in Book VII, Chapter 3.
Try storing the database in a trusted location (such as your hard drive) to
enable action queries.
Creating action queries safely
You need to perfect an action query before you run it so that you don’t
wreck your data. (If you make a mistake, you have a backup, right?) Make
the action query, look at it, maybe test it on a few records in a test table, and
then finally run it.
The process for creating an action query is as follows:
1. Back up your database or make copies of the tables that the action
query will change.
Because action queries can do so much work (good or bad), make a
backup before you run the query.
2. Create a select query to show the data needed for the action query.
Click the Query Design or Query Wizard button on the Create tab of the
Ribbon. Add tables (or queries) and fields to the design grid. Define
criteria and sort order as needed.
The point is to create a query that displays the records that the action
query acts on.