Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Location
    Essex, United Kingdom
    Posts
    6

    Question Sorting data in ADO Recordset

    I am trying to calculate time between failures on a large dataset of repairs.

    I am attempting to pull in the data from a query into an ADO recordset, sort the recordset and then step through the recordset, processing as I go. However every time I process the data the sort does not work.

    My VBA for calling the data an sorting the data is below, can anyone tell me what I am doing wrong



    Code:
    Dim rstAllRepairs As Recordset
    Set rstAllRepairs = CurrentDb.OpenRecordset"qry_RepairsOrderedForMTBFCalculations")
     
    rstAllRepairs.Sort = "rpr_JobNumber DESC, rpr_Model DESC,rpr_SerialNumber DESC"

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Is your recordset not aready sorted in the query itself? If you specify the sort order in the report it should cascade through to the recordset.

    David

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-31-2009, 03:57 AM
  2. ADO.Recordset - Write
    By Marvin in forum Programming
    Replies: 0
    Last Post: 07-17-2009, 07:56 AM
  3. Create a recordset for a report
    By vjboaz in forum Programming
    Replies: 0
    Last Post: 11-18-2008, 03:28 PM
  4. Add new Recordset using Recorset by Query
    By gailoni in forum Programming
    Replies: 1
    Last Post: 10-22-2008, 11:52 PM
  5. Sorting data in a report
    By rjsiler in forum Reports
    Replies: 1
    Last Post: 08-04-2008, 01:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums