MoveNext not moving in order

Posted on 2006-04-12
Last Modified: 2008-03-17
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")
While Not rs.EOF

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

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!
Question by:horalia
    LVL 92

    Accepted Solution

    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.



    Author Comment

    Worked. Thanks!
    LVL 92

    Expert Comment

    by:Patrick Matthews
    You're welcome :)

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now