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".
- From Datasheet View, switch to Design View by clicking on the Design View icon (from the tool bar):
(If you can't see this icon, select "Design View" from the "View" menu). You should now see something like this:
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. - 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:
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](/pix/microsoft_access/microsoft_access_2003/tutorial/modify_a_query_3.gif)
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.
-
Access 2016 Tutorial
This tutorial covers a lot more than was in the 2003 tutorial.
Microsoft Access 2016 is the successor to Access 2013.
Go to Access 2016 Tutorial -
Database Tutorial
If you don't currently have an understanding of how databases work, no worries — I have written a basic database tutorial just for you!
This tutorial covers the basic concepts of databases, and the examples use Microsoft Access, so that will make it easier for you once you return to the Access tutorial.
Go to the Database Tutorial