Modules >>
Access I >>
Sorting and filtering records (Access 97)

Sorting records

The datasheet view of the table you created will always appear sorted in ascending order of the data in the primary key field. In a previous lesson, you set the field for the last name as the primary key field.  If you want to view the table sorted by a different field, click on any cell in the desired field then click either the ascending or descending sort button in the toolbar, which look like the following:

ascendbt.jpg (935 bytes) descend.jpg (1029 bytes)

Filtering records

A filter allows you to apply a set of selection criteria and/or sorting instructions to the records in a table. The act of the filter is temporary, so the next time you view your data, you will have to repeat the filter process to view selected records a second time.

In either the table or form view, you may apply a filter to the records.  To do this, go to the "Records" menu and select "Filter" to view the following options:

dbfilter.jpg (9133 bytes)

Using Filter by Form, you can select a drop-down menu in a selected field and choose a value you wish to search for.  Next, you can click on the "OR" tab to add another value from that same field.  When you have finished making your selection, go to the Records menu shown above and select "Apply Filter/Sort."  Remember, that EACH TIME you apply a filter, you must undo that action in order to again view all of your records.  To do this, select "Remove Filter/Sort" from the above Records menu.

You may also access the filter options by right-clicking on the field you wish to search.  You can select "Filter For" and type in the text you wish to search, then press Enter. You will then be shown the records that contain that value in the field you selected.  Remember to select "Remove Filter/Sort" to return to viewing all records in your database.

The Advanced Filter/Sort option will allow you to combine fields and identify more complex search criteria.  There is no filter or sort assignment for this module. For more information on Filters and Sort, go to the Help menu and search for these topics.

Please continue to the next section on Creating a Query.

arrow_orange_stubby_up.gif (875 bytes)

Copyright © 2001-2002 Valerie Irvine. All rights reserved.
Revised: October 29, 2002.