• DCount using an SQL (Access 2003)

    Author
    Topic
    #432794

    Hello,

    According to Microsoft’s help, the DCount functions ‘domain’ must be a Table Name or a Query Name, however I want to use an SQL defined in my code. Is their a way this can be done? If not, what is the most efficient way to count records in an SQL statement without creating a query. I do realize that I could define the SQL as a recordset and do a recordcount, but this is time consuming.

    Thanks in advance for any help!
    Regards,
    Drew

    Viewing 0 reply threads
    Author
    Replies
    • #1016117

      I’m afraid that you’ll have to open a recordset. Why is that more time consuming than using DCount?

      • #1016170

        The last test I ran opened a form and populated appoximately 10 captions with the number of records in 10 different tables. Originally I used DCount for this and had no problems. It worked fast with no delay. When trying to make my code more efficient, I used the recordset approach. After that, the form took 3-5 seconds to open (can’t remember how many records were in each table…if that matters).

        Thanks for your help. I will try using the recordset approach on this one. May just live with the delay.
        Regards,
        Drew

    Viewing 0 reply threads
    Reply To: DCount using an SQL (Access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: