Filtering
Top  Previous  Next

Sorting and filtering are tools that come with Microsoft Access and make it possible to view records in a table in different and more detailed and specific ways either by reordering all of the records in the table or viewing only those records in a table that meet certain criteria that you specify.

Sorting
You may want to view the records in a table in a different order than they appear such as sorting by a date or in alphabetical order, for example. Follow these steps to execute a simple sort of records in a table based on the values of one field:

   1. In table view, place the cursor in the column that you want to sort by.
   2. Select Records|Sort|Sort Ascending or Records|Sort|Sort Descending from the menu bar or click the Sort Ascending or Sort Descending buttons on the toolbar.

To sort by more than one column (such as sorting by date and then sorting records with the same date alphabetically), highlight the columns by clicking and dragging the mouse over the field labels and select one of the sort methods stated above.

Filter by Selection
This feature will filter records that contain identical data values in a given field such as filtering out all of the records that have the value "Smith" in a name field. To Filter by Selection, place the cursor in the field that you want to filter the other records by and click the Filter by Selection button on the toolbar or select Records|Filter|Filter By Selection from the menu bar. In the example below, the cursor is placed in the City field of the second record that displays the value "Ft. Myers" so the filtered table will show only the records where the city is Ft. Myers.


Filter by Form
If the table is large, it may be difficult to find the record that contains the value you would like to filter by so using Filter by Form may be advantageous instead. This method creates a blank version of the table with drop-down menus for each field that each contain the values found in the records of that field. Under the default Look for tab of the Filter by Form window, click in the field to enter the filter criteria. To specify an alternate criteria if records may contain one of two specified values, click the Or tab at the bottom of the window and select another criteria from the drop-down menu. More Or tabs will appear after one criteria is set to allow you to add more alternate criteria for the filter. After you have selected all of the criteria you want to filter, click the Apply Filter button on the toolbar.

For a how to on using the Filter by Form tool applying to the Program, see the How To on conducting Physical Inv Adjustments.



The following methods can be used to select records based on the record selected by that do not have exactly the same value. Type these formats into the field where the drop-down menu appears instead of selecting an absolute value.


Filter by Form
Format
Explanation
Like "*Street"
Selects all records that end with "Street"
<="G"
Selects all records that begin with the letters A through G
>1/1/00
Selects all dates since 1/1/00
<> 0
Selects all records not equal to zero


Remove a Filter
To view all records in a table again, click the depressed Apply Filter toggle button on the toolbar.

Here are some links with more information on Filtering:
http://www.educ.uidaho.edu/bustech/Information_Systems/Database/SORTING.HTM
http://tutorials.findtutorials.com/read/category/104/id/255
http://www.estevancomp.ca/tonita/database/access/lesson14.htm