1. Computing

"CREATING A SIMPLE QUERY" > Page 1, 2, 3

4. Select the appropriate table from the pull-down menu.  When you select the pull-down menu, you'll be presented with a listing of all the tables and queries currently stored in your Access database.  These are the valid data sources for your new query.  In this example, we want to first select the Products table which contains information about the products we keep in our inventory.

5.  Choose the fields you wish to appear in the query results. by either double-clicking on them or by single clicking first on the field name and then on the ">" icon.  As you do this, the fields will move from the Available Fields listing to the Selected Fields listing.  Notice that there are three other icons offered.  The ">>" icon will select all available fields.  The "<" icon allows you to remove the highlighted field from the Selected Fields list while the "<<" icon removes all selected fields.  In this example, we want to select the ProductName, UnitsInStock, and UnitsOnOrder from the Product table.

6.  Repeat steps 4 and 5 to add information from additional tables, as desired.  In our example, we wanted to include information about the supplier.  That information wasn't included in the Products table -- it's in the Suppliers table.  Here's the power of a query!  You can combine information from multiple tables and easily show relationships. In this example, we want to include the CompanyName and Phone fields from the Suppliers table.  All you have to do is select the fields -- Access will line up the fields for you!  

Note that this works because the Northwind database has predefined relationships between tables.  If you're creating a new database, you'll need to establish these relationships yourself.  Read the article "Defining Relationships in Microsoft Access" for more information on this topic.

7.  Click on Next.

8.  Choose the type of results you would like to produce.    We want to produce a full listing of products and their suppliers, so choose the Detail option here.   

Next page > Finishing Up > Page 1, 2, 3

Discuss in my forum

  1. About.com
  2. Computing
  3. Databases

©2013 About.com. All rights reserved.