Lesson3.3.Filtering by Selection


Lesson 3.3. Filtering by Selection

Figure 3-5. Filtering a table by selection.


Figure 3-6. The table is filtered so that only records that have "WA" in the Region field are displayed.


Sometimes you may want to see only certain records in your table. By a table, you display only the records that meet your criteria and hide the records that do not. For example, you could filter a client list to display only clients who live in California.

There are several filter methods:

  • Filter by Selection: The fastest and easiest of the three filter commands. Simply find and select the value you want to use as the filter criteria, and then use Filter By Selection to find all records with the selected value.

  • Filter by Form: Here you type your filter criteria into a blank form that contains all the field names in the table. Works well if you have more than one criteria.

  • Advanced Filter/Sort: The most powerful and complicated filter method. Creating an advanced filter is really not any different from creating a query.

In this lesson, you will learn how to use the fastest and easiest way to filter a list with the nifty Filter by Selection feature.

  1. If it isn't already open, find and open the Employees table.

    The first step is finding a record and field that matches your criterion. For example, to find all the addresses from Minnesota you would put the cursor in any State field that contained MN.

  2. Find the Region field and then right-click any WA value.

    A shortcut menu appears, as shown in Figure 3-5. Notice that the shortcut menu actually contains four filter-related commands. You can read more about these commands in Table 3-3.

  3. Select Filter By Selection from the shortcut menu.


    Tip: Another way to filter by selection is to select the record and field that matches your criterion and click the Filter by Selection button on the toolbar.

    Access filters the table so that only records that contain "WA" in the Region field are displayed, as shown in Figure 3-6. Notice that the bottom of the table window tells you the number of records that match your filter criteria. Also the message (Filtered) indicates that the table is currently being filtered.

    Here's how to remove a filter:

  4. Click the Remove Filter button on the toolbar.

    All the records in the table are displayed.

    The opposite of Filter by Selection is , which filters all records that don't contain the criteria value. For example, to find all the addresses that aren't from Minnesota, you would put the cursor in any State field that contained MN.

  5. Find the City field and then right-click any London value. Select Filter Excluding Selection from the shortcut menu.

    This time Access displays all the records that do not contain London in the City field.

  6. Click the Remove Filter button on the toolbar.

    All the records in the table are displayed.

Table 3-3. Filter Shortcut Menu Commands

Command

Description

Filter by Selection

Finds and displays all records with the selected value.

Filter Excluding Selection

Finds and displays all records that don't contain the selected value.

Filter For

Finds and displays all records that match the text you enter.

Remove Filter/Sort

Removes the applied filter from the table.


QUICK REFERENCE

TO FILTER BY SELECTION:

  1. FIND THE FIELD VALUE ON WHICH YOU WANT TO BASE THE FILTER.

  2. RIGHT-CLICK THE FIELD VALUE AND SELECT FILTER BY SELECTION FROM THE SHORTCUT MENU.

OR...

CLICK THE FIELD VALUE, THEN CLICK THE FILTER BY SELECTION BUTTON ON THE TOOLBAR.

TO FILTER EXCLUDING THE SELECTION:

  • RIGHT-CLICK THE FIELD VALUE YOU WANT TO EXCLUDE AND SELECT FILTER EXCLUDING SELECTION FROM THE SHORTCUT MENU.

TO REMOVE A FILTER:

  • RIGHT-CLICK THE FILTERED TABLE AND SELECT REMOVE FILTER/SORT FROM THE SHORTCUT MENU.

OR...

  • CLICK THE REMOVE FILTER BUTTON ON THE TOOLBAR.




CustomGuide Inc - Access 2003 Personal Trainer
Access 2003 Personal Trainer (Personal Trainer (OReilly))
ISBN: 0596009372
EAN: 2147483647
Year: 2005
Pages: 209

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net