Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count for a field 1

Status
Not open for further replies.

dday01

Technical User
Feb 1, 2002
138
US
Hi All,

This is probably simple, though I don't know how to do it. I have a report and I want to add a field in a section footer that gives a count for how many times the value of 'X' shows up. I added a text box to the section footer and put the following formula in the rowsource:
=DCount("submit1","qryImpStatusrpt","[submit1] = 'X'").

The problem is that it gives me a count of the value of X for the whole report in each section, does not give an individual count for each section. Any ideas?

Thanks,

D
 
yes it gives you the whole count cause that's what your dcount statement is asking for.

you have to add the criteria that will only count the x's for this particular section.
so pick whatever is your heading group and add it to your criteria:


if that field is TEXT (need single quotes):

=DCount("submit1","qryImpStatusrpt","[submit1] = 'X' and HeaderFieldName = '" & [headerfieldname] & "'")


if that field is NUMBER (no single quotes):

=DCount("submit1","qryImpStatusrpt","[submit1] = 'X' and HeaderFieldName = " & [headerfieldname])


 
GingerR,

Thanks, that did the trick! Much appreciated.

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top