Results 1 to 8 of 8
  1. #1
    easyrider is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2021
    Location
    Lancaster County, PA
    Posts
    46

    Sorted continuous subform - inconsistent results

    Hi all,



    I have a continuous subform (called Service_F) that shows the service history of the record that is currently shown in the parent form, Vehicle_F.

    For simplicity, the Service_F has three fields: ServiceDate, Description, RepairShop.

    I have the OrderBy property of the subform set to ServiceDate DESC. But the results are inconsistent. Some vehicle records will show the service history in ascending order while others show it in descending order (which is what I want - most recent on top).

    Anybody have an idea where I should look to fix this?

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Suggest you provide db for analysis. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Anybody have an idea where I should look to fix this?
    Sorting on more than 1 field? The field is text, not date data type? You're using Format function on a date field, which coerces dates to string data type? You're using GroupBy?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I have the OrderBy property of the subform set to ServiceDate DESC.
    I suspect it is not always being applied. Suggest instead use Order By in the subform recordsource

  5. #5
    easyrider is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2021
    Location
    Lancaster County, PA
    Posts
    46
    Quote Originally Posted by June7 View Post
    Suggest you provide db for analysis. Follow instructions at bottom of my post.
    This DB does the same thing and was easier to strip out all of the confidential data and replace it with meaningless data. There are only 3 records in the main property table.

    When I pull up the property record form, I can scroll through the 3 properties via the nav buttons at the bottom and the continuous subform is sorted correctly. However, when I search for a property (search button next to address line) the resulting "filtered" record continuous subform is sorted in ascending order. If I turn off the filter, the property form goes back to the first record and the subform is still in ascending order. If I close the form and reopen it, the subform is sorted in descending order.

    I broke something stripping out the info, so ignore the main menu and just open the PropertyRecord_F

    So, my hunch is that it has something to do with the filter... ??

    SortTestDB.zip

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    As I suggested in post#4, use the order by in the recordsource

    SELECT Service_T.* FROM Service_T ORDER BY Service_T.LastPumpDate DESC;

  7. #7
    easyrider is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2021
    Location
    Lancaster County, PA
    Posts
    46
    Quote Originally Posted by Ajax View Post
    As I suggested in post#4, use the order by in the recordsource

    SELECT Service_T.* FROM Service_T ORDER BY Service_T.LastPumpDate DESC;
    Sorry for being dense Ajax, but how do I do that? (brain not working today...)

    nvrmnd, I figured it out and that works, Ajax. Thank you!!

    Would love to know the technical reason why, but will have to save that for another day.

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    deleted as OP has worked it out



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

Similar Threads

  1. Replies: 15
    Last Post: 08-27-2021, 10:31 AM
  2. Update Queries with Inconsistent Results
    By Netopia in forum Modules
    Replies: 5
    Last Post: 07-10-2018, 02:26 PM
  3. Inconsistent results with a simle query
    By slickdog in forum Queries
    Replies: 4
    Last Post: 10-07-2015, 06:01 AM
  4. Inconsistent results.. please help!
    By vikghai in forum Access
    Replies: 6
    Last Post: 02-09-2014, 05:37 PM
  5. Replies: 1
    Last Post: 09-01-2012, 06:58 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