Recordcount of filtered recordset slow

Posted on 2006-04-10
Last Modified: 2013-12-25
I am using the rst.Filter method and then trying to do a count of the filtered recordset. The problem is that the recordcount pauses for about 10-15 seconds. But for other larger recordset that are not filtered, recordcount works pretty fast. Does anyone know why this is or how I can get around it.
Question by:leeskelton83
    LVL 12

    Accepted Solution

    The filter method is slow, especially if you have a lot of records or criteria.

    It would be better to set another recordset variable and create an sql string to execute to fill it. You can use your filter condition as a where clause in the sql. This should be much faster.

    LVL 3

    Author Comment

    I was trying to avoid opening another recordset but oh well.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    vba find the last empty column 10 72
    Use Multiple Forms 4 30
    vb6 connector to SQL Server 2 20
    How does CurrentUser work? 10 10
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    760 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

    15 Experts available now in Live!

    Get 1:1 Help Now