Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort Recordset

Status
Not open for further replies.

Sadukar

Technical User
Feb 19, 2003
159
IE
Hi all

I want to sort a subform by a particular field.

How do I do it?

Something like this???

With Me.Subform_Aujado
Recordset.Sort = !Datefield

Thanks for your time.
S.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top