Help with DCount counting records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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
 
Back
Top