Help with DCount counting records

P

pokdbz

I am having problems with DCount on reports.

I have a query HispanicReportQuery which has the fields:
Race
Hispanic
StudyTitle

What I need to do is count the number of people for each race and each study.

So this is what I envisioned the output looking like:

Study: Study1
White: 5
Black/Af. Am.: 6
Asian: 3

Study: Study 2
White: 10
Black/Af. Am.: 2
Asian: 7

This is what I have for the DCount of the White field
=DCount("StudyTitle","HispanicReportQuery","HispanicReportQuery.Race=White")

Maybe I am going about this wrong, do you have any suggestions what the
problem might be?
 
L

Larry Linson

I think I would address this problem by using a Totals Query as the Record
Source, with Group By selected for Study, then by Race.

Using DCount is going to be slow, at best.

Larry Linson
Microsoft Access MVP
 
P

pokdbz

Sorry but they also have to be grouped by if they are hispanic or not
so:

Hispanic
Study: Study1
White: 5
Black/Af. Am.: 6
Asian: 3

Non-Hispanic
Study: Study2
White: 10
Black/Af. Am.: 2
Asian: 7

I don't know if that makes a difference or not.
So do I have to use the DCount or can I just use the Total Query
Could you explain this a little more for me.
Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top