Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

Print Version

Microsoft Access - Modify a Query

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): 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:
    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:
    Modifying a query - step 2

The Result

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

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.

Enjoy this website?

  • Share
  • Add this page to your Favorites
  • Link to this page (copy/paste into your own website or blog):
  • Link to Quackit using one of these banner ads.
  • Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

© Copyright 2000 - 2010 Quackit.com