ACC2000: How to Create a Custom Sort Order (304564)
The information in 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).
SUMMARY
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: - Inside Sales Coordinator
- Sales Manager
- Sales Representative
- Vice President, Sales
However, you may want to sort these titles with a custom sort order, such as: - Vice President, Sales
- Sales Manager
- Inside Sales Coordinator
- Sales Representative
REFERENCESFor 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.
Modification Type: | Major | Last Reviewed: | 6/25/2004 |
---|
Keywords: | kbhowto KB304564 |
---|
|