Re: open recordset sort order

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nikos Yannacopoulos (nyannacoREMOVETHISBIT_at_in.gr)
Date: 03/12/04


Date: Fri, 12 Mar 2004 10:40:00 +0200

The trick is to use an SQL query rather than the table itself in the
recordset definition, and do the sorting in the query, e.g.

strSQL = "SELECT * FROM MyTable ORDER BY MyField"
set rst = CurrentDb.OpenRecordset(strSQL)

HTH,
Nikos

"CN" <anonymous@discussions.microsoft.com> wrote in message
news:b88401c40803$77d5c940$a501280a@phx.gbl...
> Is there a way that I can sort the results that the
> records are returned when using CurrentDb.OpenRecordset
> ("MyTable").
>
> I have a field in 'MyTable' that I want to use to drive
> this sort order so I can loop through the record set based
> on that field.
>
> Any ideas would be really appreciated. Thx!
>



Relevant Pages

  • Re: tweak of A2002 Enterprise Dev Handbook fails?
    ... Set rst = New ADODB.Recordset ... system stored procedure, leading it to look for it in the Master database ... Set prm = cmd.CreateParameter("WeekendNo", adInteger, ... Execute method creates a NEW recordset object with default properties and ...
    (microsoft.public.data.ado)
  • RE: Running Parameter Query from a form
    ... "fervet" wrote: ... Also, you can see what is in each recordset field with ?rst!Level1, etc. ... Set rst = qdf.OpenRecordset ... different textboxes that i want to populate with the results from the query. ...
    (microsoft.public.access.formscoding)
  • RE: Running Parameter Query from a form
    ... Also, you can see what is in each recordset field with ?rst!Level1, etc. ... "fervet" wrote: ... Set rst = qdf.OpenRecordset ... different textboxes that i want to populate with the results from the query. ...
    (microsoft.public.access.formscoding)
  • RE: Running Parameter Query from a form
    ... Also, you can see what is in each recordset field with ?rst!Level1, etc. ... "fervet" wrote: ... Set rst = qdf.OpenRecordset ... different textboxes that i want to populate with the results from the query. ...
    (microsoft.public.access.formscoding)
  • RE: Find Record but Remove Filter
    ... It means it is not finding the value in the form's recordset. ... Set rst = Me.RecordsetClone ... Dim stDocName As String ... Then in the Load event of frmReeferMain ...
    (microsoft.public.access.formscoding)