Article ID: 304564 - View products that this article applies to.
This article was previously published under Q304564
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
This article shows you how to create a custom sort order by using the Switch function.
Sometimes, you may want Microsoft Access to sort based on a custom sort order (that is, not ascending or descending, but a different, user-specified sort order).
For example, the Northwind sample database contains an employees table in which an employee may have one of four possible titles. Access sorts these titles alphabetically as:
To create a custom sort order on the Employees table in the Northwind Sample Database, follow these steps:
For more information about the Switch function, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type switch function in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Article ID: 304564 - Last Review: June 25, 2004 - Revision: 2.0
Contact us for more help