Creating a Select Query with a Wizard



After you've opened the database on which you want to base a query, click the Queries button in the Objects bar.


Double-click the Create query by using wizard option.


The Simple Query Wizard starts. Click the down arrow next to the Tables/Queries field and choose the table on which you want to base the query from the list that appears.


The Available Fields list includes all the fields in the selected table. Click the first field that you want to include in the query (here, FirstName).


Unlike other wizards, the Simple Query Wizard creates a table of sorts, which you use to select the fields you want to include in the query. The wizard then creates a simple select query, where you can type the value to match in Query Design view. A select query selects records that match the value you enter. (To create a different type of query, simply enter the necessary criteria to the query you build here; you'll learn how later in this part.)


Selecting a Table

Pick the table that contains that data you want to search and pull specific entries from. For instance, if you want to create a query with product inventory results, use the product inventory table.



Click the Add button (the one that contains a single right-pointing arrow).


The field is added to the Selected Fields list. Continue selecting and adding fields until all the fields you want are added.


When all the desired fields have been added, click the Next button.


The next screen of the Simple Query Wizard opens. In the What title do you want for your query field, type a name for the query; the query will be saved with this name.


Adding and Removing Fields

If you want to include in your query all the available fields in a table, skip steps 4 and 5 and instead click the >> button in the first screen of the Select Query Wizard. To remove a field from the Selected Fields list, click the field to select it, and then click the < button.



To open the query, click the Open the query to view information option button, as shown here. (Alternatively, to make changes to the query, choose Modify the query design.)


Click the Finish button.


Access displays the select query you have created, which consists of a table that contains the fields you selected. You next need to build the criteria as covered later in this part.


Saving the Query

When you use a wizard to create a query, that query is saved automatically using the name you typed in step 8. If you make changes to the query later, however, you'll need to resave the query. For help, see the task "Saving a Query" later in this part.


Other Wizard Types

You can also use wizards to find duplicate records, to find unmatched records (this pertains to relationship tables, covered in Part 8), and to create a crosstab query (not covered in this book).