• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

MoveNext not moving in order

I have a table named tblRHS which contains the following four records only:

Job_Order_Number      Action_Time                      Status_Name
0000100059      2/3/2006 10:35:45 AM      Import
0000100059      2/5/2006 3:04:18 AM                      Exported
0000100060      2/5/2006 3:02:11 AM                      Mine
0000100669      2/5/2006 3:00:17 AM                      Yours

I created a recordset which moves through all records, except it does not move in the table order. Here's the code:

Set rs = CurrentDb.OpenRecordset("tblRHB")
rs.MoveFirst
While Not rs.EOF
   rs.MoveNext
Wend

If I add a watch when running through the code, rs!Status_Name will show all the records in the following order:
Import
Mine
Export
Yours

How can I set my code up to read the records in the same order the table has them? I tried finding rhyme or reason as to why the records are being read in this order and found none. I have also used a do loop and will do the same thing. Thanks!
0
horalia
Asked:
horalia
  • 2
1 Solution
 
Patrick MatthewsCommented:
Hi horalia,

If you need records processed in a particular order, then you should use a query to define the recordset, and have
the ordering determined in that query.

Regards,

Patrick
0
 
horaliaAuthor Commented:
Worked. Thanks!
0
 
Patrick MatthewsCommented:
You're welcome :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now