Access 2007 record count

Posted on 2009-02-20
Last Modified: 2012-05-06
I have queries that count the number of records in 3 files, E1, E2, E3

I use
NumRecordsE1: Format(CStr(Count([TalxE1]![YEAR])),"0000000")
NumRecordsE2: Format(CStr(Count([TalxE2]![YEAR])),"0000000")
NumRecordsE3: Format(CStr(Count([TalxE3]![YEAR])),"0000000")

I need to put these record counts into another table called Z1 with 4 fields:
Z1, E1 count, E2 Count, E3 Count

I know I can append each query but that leaves me with 3 records. One for each. I only need one record with the counts.

Question by:DominicConstable
    LVL 92

    Accepted Solution

    INSERT INTO Z1 (Z1, [E1 count], [E2 Count], [E3 Count])
    VALUES ("foo", DCount("*", "TalxE1"), DCount("*", "TalxE2"), DCount("*", "TalxE3"))

    Not sure what was going into field Z1, so I put in a dummy value...

    Author Closing Comment

    perfect solution

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 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