Sorting Nav Pane Objects by Description
I've recently had some questions from users who used to sort their DBC by the description field and wanted to be able to do the same thing in the 2007 navigation pane. If you use this scenario, and you've tried in 2007, you'll know that the navigation pane doesn't have a sort by the description field. One way to work around this is to create a query that does it for you.
Here's a sample that lists the user Query objects in the database along with their descriptions. Note because the Description property is not stored as a field in MSysObjects, you need some accompanying VBA logic to retrieve the description property from the property bag.
First, add this function in VBA:
Public Function stDesc(stQryName As String) As String
On Error Resume Next
stDesc = CurrentDb.QueryDefs(stQryName).Properties("Description")
End Function
Then run this query:
SELECT MSysObjects.Name, stDesc([Name]) AS Description
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "~*") AND ((MSysObjects.Type)=5))
ORDER BY stDesc([Name]);
Zac is a Program Manager at Microsoft on the team designing Access’s next generation platform infrastructure. He advocates easy to use designs, organizes community efforts, and is the author of The Rational Guide to Microsoft® Office Access 2007 Templates. Zac has been working at Microsoft Corporation since 1999. Before that time, he attended the University of Idaho, from which he holds a B.S. in Computer Science.