As with the other objects that you will use in Access, queries are a very important part of making your life easier.
They allow you to view your data in just about any order you need. They also help you to perform bulk operations on records such as appending, deleting, and updating records.
This module covered how to extend your queries to the fullest. Some of the topics covered were:
Use Filter by Selection and Filter by Form while in a query’s datasheet
Use a parameter with your query to specify criteria dynamically
Use multiple criteria in a query using the AND and OR operators
Set properties for fields in queries
Identify fields you can index to improve query performance
Identify the three different types of joins available and how they can be used
Discuss the different types of queries and where you would use them
Create action queries to perform bulk operations
Work with a Totals query to present group totals
Explain what Crosstab queries are and how to create them.
Creating a Query
After you create your tables and place data in them, you are ready to work with queries.
To begin a query, select the Create tab on the Ribbon, and click the Query Design button in the Queries group.
This opens the Query Designer shown in Figure 3-12. Figure 3-12 shows two windows. The underlying window is the Query Designer. Floating on top of the Query Designer is the Show Table dialog box. The Show Table dialog box is
modal, which means that you must do something in the dialog box before continuing with the query. Before you continue, you add the tables required for the query. In this case, tblProducts is highlighted and ready to be added.
The Show Table dialog box (refer to Figure 3-12) displays the tables and queries in your database. Double-click tblProducts to add it to the query design, or highlight tblProducts in the list and click the Add button. Close the Show Table dialog box after adding tblProducts. Figure 8.2 shows tblProducts added to the query. To add additional tables to the query, right-click anywhere in the upper portion of the Query Designer and select Show Table from the shortcut menu that appears. Alternatively, drag tables from the Navigation pane to the upper portion of the Query Designer. There is also a Show Table button on the Design tab of the Ribbon. Removing a table from the Query Designer is easy. Simply right-click the table in the Query Designer and select Remove Table from the shortcut menu.