Getting to Know Microsoft Access, Part 5: Retrieving and Arranging Data Meaningfully - Filtering
(Page 2 of 4 )
Sometimes you want to see only certain records; in these cases you can filter your form, datasheet, or subdatasheet according to the criteria you specify. Filtering doesn’t delete records, it just hides certain records from view so it’s easier for you to see the records you want to see. There are five types of filters in Access:
- Filter By Selection: Shows values identical to the one you selected. You can use filter by selection on any data type except OLE. Once you’ve selected the record or records you want to filter choose the Records | Filter | Filter by Selection menu option to apply the filter.
- Filter Excluding Selection: Shows only those records that don’t have the value you selected. Select the record or records you don’t want to see and choose the Records | Filter | Filter Excluding Selection menu option to exclude those records that match your selection.
- Filter By Form: Shows records based on the criteria you give in a blank table view. To filter by form choose Records | Filter | Filter By Form. The only difference between filtering by form and filtering by selection (above) is that in Filter By Form you choose the value to filter in a filter grid, instead of choosing a value from a datasheet. This grid looks like one table record that shows all the fields in your table. You can combine filter criteria to get a more interesting filter by selecting multiple values in the grid fields.
- Filter For: A shortcut menu box that allows you to enter filter criteria. To use Filter For, right-click the value you want to filter in the datasheet view and select the Filter For menu option: type in the expression you want to filter in the box next to the menu option. There are many types of expressions you can use to filter records with Filter For (and also with Filter By Form). I’m not going to cover them here, but you can do a search In Access help for "filter for" and then select the "Example of Filter Criteria" from the results to see the various types of commands you may use with Filter For and Filter By Form.
- Advanced Filter/Sort: Allows you to specify both a filter and a sort at the same time. The Advanced Filter/Sort lets you choose any and all of the Filter By Form options while simultaneously choosing sort options to apply to the table as well. Choose Records | Filter | Advanced Filter/Sort to use the Advanced Filter/Sort feature.
When you’ve applied a filter to an Access table the status bar, at the bottom, shows the acronym FLTR, meaning that a filter has been applied to the data. This way you know you are not viewing the whole dataset. To save a filter, make sure you first apply a filter, and then select the Save as Query toolbar button.
Next: Basic Queries >>
More Microsoft Access Articles
More By Sage Adams