Access 2007 record count

Posted on 2009-02-20
Medium Priority
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 93

Accepted Solution

Patrick Matthews earned 2000 total points
ID: 23695039
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

ID: 31549377
perfect solution

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
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…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

807 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