Microsoft Access 2003 - Modify a Query

See Microsoft Access Tutorial for a tutorial on a more recent version of Access.

In the previous lesson, we created a query using the "Simple Query Wizard". In this lesson, we will modify that query using "Design View".

  1. From Datasheet View, switch to Design View by clicking on the Design View icon (from the tool bar): MS Access 2003: Modifying a query - step 1
    (If you can't see this icon, select "Design View" from the "View" menu). You should now see something like this:
    MS Access 2003: Modifying a query - step 1a
    The top panel shows us the tables that are used in this query (we only use one table in our query). The bottom panel is where we specify what to do with each field in the table. We can nominate to display a field or not display it. We can sort the results by any of these fields. We can also provide criteria to be used in filtering the results. We'll do this in the next step.
  2. In the "Criteria" cell for the "FirstName", add the word "Homer". While you're there, add the IndividualId field so that it will also be displayed in our results. Do this by selecting "IndividualId" from the dropdown menu on the third column. Also, ensure that the "Show" checkbox is checked:
    MS Access 2003: Modifying a query - step 2

The Result

Now when you switch back to Datasheet View, you should now see something like this:

MS Access 2003: Modifying a query - final result

So you can see that, once we get a lot more data into our database, queries can be very useful. Imagine if there were 100 individuals in our database called "Homer". You could also add criteria into the "Or" field. For example, you might want to search for individuals called either "Homer" or "Barney".

You may need to practice this to get a good understanding of what it can do. Switch back and forth between Design View and Datasheet View as many times as you like. Change the criteria, add some fields, show fields, don't show them...

Once you become familiar with queries, you'll realise the true benefits of database management systems.


Update

Since this tutorial was written, there have been many subsequent updates to Access. Here's the latest Access tutorial.