Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8400027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:27:32+00:00 2026-06-09T21:27:32+00:00

I have an access 2003 front end database with a form that allows users

  • 0

I have an access 2003 front end database with a form that allows users to see a sorted and/or filtered view of some data. The data is displayed in a sub-form.

The base data (loaded when the form is opened) is retrieved into a disconnected ADODB.Recordset object (static client side cursor). The sub-form’s Recordset property is set to the disconnected recordset and all records are displayed.

Applying just a sort (in code) to the recordset object and then setting the sub-form to use the sorted recordset displays the data with the correct sort applied. The filter property is set to adFilterNone for this to work. All records are displayed (correct).

Applying just a filter (in code) to the recordset object and then setting the sub-form to use the filtered recordset displays the data with the correct filter applied. The sort property is set to an empty string for this to work. All records matching the filter are displayed (correct).

When both the sort property AND the filter property are set on the recordset, and that recordset is then set to the sub-form’s Recordset property, only the first 100 matching records are displayed (incorrect). They are displayed in sort order. The underlying recordset object shows the correct record count for the filtered records, they just don’t all display on the form.

Does anyone know why this is happening and if there is a way to get around this apart from creating a recordset using a new SQL string each time?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:27:33+00:00Added an answer on June 9, 2026 at 9:27 pm

    What you are seeing with filtering and sorting is a known limitation of ADO recordsets.

    Take a look at the list of ADO Cons listed on this page. Notice the one on the bottom:
    http://www.utteraccess.com/wiki/index.php/Choosing_between_DAO_and_ADO

    I couldn’t find any documentation on MS’s Support site about this so I don’t know if it’s a bug or simply a limitation. I’m assuming it’s the latter.

    FYI, I think MS has basically forgotten about ADO (classic). The last release of MDAC (which is how you obtain ADO) was 5/10/2005.

    As far as a work-around for this problem, you can try using this function. It returns a new, filtered and sorted recordset. Just keep a big, full recordset handy and use this function to get a new one every time you do a sort/filter. This does increase your overall resource usage, especially memory.

    I have used this function but it hasn’t been fully tested to make sure it’s bullet proof in every way. You might quickly find some bug or limitation with it. I actually had a note that it needed some kind of work but my note was unclear, I didn’t have time to test it now, and I did find that I’m using this function in my production code so I think it’s working.

    Public Function GetFilteredRecordset(ByRef rsSource As ADODb.Recordset, _
                                            ByVal sWhere As String, _
                                            Optional ByVal sOrderBy As String, _
                                            Optional ByVal LockType As ADODb.LockTypeEnum = adLockUnspecified) As ADODb.Recordset
    
        Dim sOriginalOrderBy As String
        sOriginalOrderBy = rsSource.Sort
        Dim F As ADODb.Field
        For Each F In rsSource.Fields
            'Debug.Print F.Name
        Next F
    
        rsSource.Filter = sWhere
        If sOrderBy <> "" Then
            If Left(LCase(sOrderBy), 8) = "order by" Then sOrderBy = Trim(Right(sOrderBy, Len(sOrderBy) - 8))
            rsSource.Sort = sOrderBy
        End If
        Dim rsF As ADODb.Recordset
    
        Dim objStream As ADODb.Stream
        'Create a New ADO 2.5 Stream object
        Set objStream = New ADODb.Stream
        'Save the Recordset to the Stream object in XML format
        rsSource.Save objStream, adPersistXML
        'Create an exact copy of the saved Recordset from the Stream Object
        Set rsF = New ADODb.Recordset
        rsF.Open objStream, , , LockType
    
        rsSource.Filter = ""
        rsSource.Sort = sOriginalOrderBy
        'Close and de-reference the Stream object
        objStream.Close
        Set objStream = Nothing
        Set GetFilteredRecordset = rsF
    End Function
    

    Another strange limitation of filtering ADO recordsets is that your OR keyword must always be on the top level. That is also documented in the link I posted above although I’m not sure if the examples given are accurate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that uses the MS Access 2003 front end to connect
I have a project that will be using Access 2003 as the front-end and
I'm using Access 2003 and have a form that allows the user to pick
Hi I have a application designed in access 2003 that has its front-end and
I have created an MS Access 2003 application, set up as a split front-end/back-end
I have a MS Access 2003 mdb acting as a front end for a
I have an Access 2010 database that I want to split into two (front
I have a form in Access 2003 that should only be working with a
I have an Ms-Access database (2003) and I have noticed that it gives OledbException:
I have an MS Access 2003 database that I'm using to develop a basic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.