Access 2000

Sorting Multiple Records

Introduction

By the end of this lesson, you should be able to:

  • Perform a multi-field sort
  • Remove a sort

Multi-field sorting

Multi-field sorting sorts the record on the first field you specify, then sorts records with the same value using another specified field. For example, you can alphabetize all of the Browns by first name.

To sort by multiple fields:

  • Open the desired form or table in Datasheet view.
  • Move the columns you want to sort so they are next to each other.

Important point Moving a column in Access is similar to moving a column in Excel.

  • Select the column by clicking the column heading . The mouse pointer becomes a white arrow with a ghost box.
  • Drag the column to the desired position. As you drag, a dark vertical line is shown moving between the columns. Release the left mouse button.
  • The column sorted first should be on the left , the second to its immediate right , and so on.
  • Select all fields (columns) involved in the multi-sort process.
  • Click the ascending or descending button on the toolbar.

Ascending and Descending Sort buttons

Multiple sorting example

To sort by Student Last Name, Student First Name, and Phone, the columns must be adjacent. In this picture, the Phone column was just moved to its appropriate position

To sort by multiple fields, select all fields involved in the sort, and click the Ascending or Descending button on the toolbar.

Multi-field sorting example

The Student table is now sorted by Last Name, First Name, and Phone

Important Point You can't perform multi-field sorts in Columnar or Tabular Form view .

To remove the sort order:

  • Choose Records lesson action Remove Filter/Sort from the menu bar.
  • If you add new records to a table that has been sorted, any new records are automatically saved .

Challenge!

  • Open the Great Lake Elementary School database.
  • In the database window, choose the Table tab from the Objects palette.
  • Double-click the Student table to open it.
  • Choose View lesson action Datasheet View from the menu bar.
  • Practice performing a multi-field sort by sorting alphabetically by Student Last Name and then by Student ID .
  • Close the database. When prompted to save changes, choose Yes .