Sorting and Filtering Records

When working in Access sort data to make it easier to work with. In Access filter data as well so you see only what you want to see.

Filtering records

Filters allow you to view only the data you want to see. When you create a filter, you set criteria for the data you want to display. The filter then searches all of the records in the table, finds the ones that meet your search criteria, and temporarily hides the ones that don't.

Filters are useful because they allow you to focus in on specific records without being distracted by the data you're uninterested in. For instance, if you had a database that included customer and order information, you could create a filter to display only customers living within a certain city or only orders containing a certain product. Viewing this data with a filter would be far more convenient than searching for it in a large table.

In our examples and explanations, we will be applying filters to tables. However, you can apply filters to any Access object. The procedure is largely the same.

To create a simple filter:

  1. Click the drop-down arrow next to the field you want to filter by. We will filter by city because we want to see a list of customers who live in a certain city.
    Selecting a field to sort by
  2. A drop-down menu with a checklist will appear. Only checked items will be included in the filtered results. Clicking Select All will select or deselect everything at once. In our example, we'll deselect everything except Cary.
    Setting the filter to only show records with "Cary" in the city field
  3. Click OK. The filter will be applied. Our customers table now displays only customers who live in Cary.
    The filtered table, now showing only the records for customers who live in Cary

Toggling your filter allows you to turn it on and off. To view the records without the filter, click the Toggle Filter command. To restore the filter, click it again.

Removing the current filter with the Toggle Filter command

Creating a filter from a selection

Filtering by selection allows you to select specific data from your table and find data that is similar or dissimilar to it. For instance, if you were working with a bakery's database and wanted to search for all products whose names contained the word chocolate, you could select that word in one product name and create a filter with that selection. Creating a filter with a selection can be more convenient than setting up a simple filter if the field you're working with contains many items. You can choose from the following options:

To create a filter from a selection:

  1. Select the cell or data you want to create a filter with. We want to see a list of all of our products that contain the word chocolate in their names, so we'll select the word Chocolate in the Product Name field.
    Selecting text to filter for
  2. Select the Home tab on the Ribbon, locate the Sort & Filter group, and click the Selection drop-down arrow.
    Clicking the Filter by Selection command
  3. Select the type of filter you want to apply. We'll select Contains "Chocolate" because we want to see records that contain the word Chocolate anywhere in the field.
    Setting the filter to show only records that contain the selected word
  4. The filter will be applied. Our table now displays only products with the word Chocolate in their names.
    The filtered table showing only records containing "chocolate" in the Product Name field