DAO has a sort method for recordset (could not find one for ADO???) Here's the poop from HELP...
Sort Property
Sets or returns the sort order for records in a Recordset object (Microsoft Jet workspaces only).
Settings and Return Values
The setting or return value is a String that contains the ORDER BY clause of an SQL statement without the reserved words ORDER BY.
Remarks
You can use the Sort property with dynaset- and snapshot-type Recordset objects.
When you set this property for an object, sorting occurs when a subsequent Recordset object is created from that object. The Sort property setting overrides any sort order specified for a QueryDef object.
The default sort order is ascending (A to Z or 0 to 100).
The Sort property doesn't apply to table- or forward-only–type Recordset objects. To sort a table-type Recordset object, use the Index property.
Note In many cases, it's faster to open a new Recordset object by using an SQL statement that includes the sorting criteria.
Skip,
Skip@TheOfficeExperts.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.