Click here to go to the Office Update Home page   All Products  |   Support  |   Search  |   microsoft.com Guide  
Featured on Office UpdateMicrosoft
   Home   |    Auto Update   |    What's New   |    Search Office Update   |    eServices   |    Office Update Worldwide   |    Site Help   |
 
Table of Contents

Sorting Records in an Access 2000 Project

About Sorting Records Before They're Retrieved from the Database

About Sorting Records After They're Retrieved from the Database

About Working Around Table and View Sort Limitations

Deciding When to Sort

How to Sort Records Before They're Retrieved from the Database

How to Sort Records After They're Retrieved from the Database

How to Work Around Table and View Sort Limitations

Summary of Sort Operations

Sorting Records in an Access Project: Additional Resources

  

How to Work Around Table and View Sort Limitations Click here to email this to a friend.

When you save a table or view, the local sort order is lost. If you want to display a datasheet with a saved sort order, you can either save the table or view as a form datasheet and then sort the records, or save the table or view as a stored procedure with an ORDER BY clause.

Save the table or view as a form datasheet
  1. In the Database window, click Tables or Views under Objects, and then select the table or view you want to save as a form datasheet.
  2. Click the arrow next to the New Object button on the toolbar, and then click AutoForm to quickly create a form.
  3. Switch to Design view.
  4. Make sure the form is selected and then click the Properties button.
  5. Click the Format tab, and then set the DefaultView property to Datasheet.
  6. Switch to Datasheet view.
  7. Do one of the following:
    To sort in ascending order, click the Sort Ascending button. To sort in descending order, click the Sort Descending button.
  8. Save your form datasheet.
Save the table or view as a stored procedure with an ORDER BY clause

If the object you want to save is a view, go to step 5. If the object is a table, do the following:

  1. In the Database window, click Tables under Objects, and then select the table you want to save as a view.
  2. Click the arrow next to the New Object button on the toolbar and then click View to create a view in the Query Designer.
  3. Select all the columns in the field list.
  4. Save your view.
  5. Copy the SQL statement from the SQL pane of the Query Designer, paste it into a stored procedure, and add an ORDER BY clause. To see a demonstration, click the Start button:

    <img src="/library/officeupdate/images/Strdproc.GIF" alt="Image" border="0" width="447" height="221">

    
 
é

© 2000 Microsoft Corporation.
All rights reserved. Terms of use.  Disclaimer.