DCount in group footer

G

Guest

I have used DCount in a report footer AOK and want to use it in a group
footer. The result is the count for the whole report not the group. Is this
not allowed or am i missing something?

Help its driving me mad!
Pete
 
G

Guest

The DCount is used to count the number of records in a table or query, to use
it on the group section so it will count for each group, you need to add a
criteria to the DCount for each group.

Or try
=Count(*)

In the Control source of the text box in the group section
 
G

Guest

Hi Ofer
Thanks for quick response but i am too thick to understand, this is what I
have in the control source
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' ")
So how do I add a "criteria"?

Pete
 
G

Guest

First, did you try

=Count(*)

=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' ")
Will return the same report where ever you use it

You need to add another criteria to the field that makes the group
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' And [FieldOfGroup]=" &
[FieldOf Group])

If that field is text and not numeric add single quote, try
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' And [FieldOfGroup]='" &
[FieldOf Group] & "'")


--
Good Luck
BS"D


Pete Rothery said:
Hi Ofer
Thanks for quick response but i am too thick to understand, this is what I
have in the control source
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' ")
So how do I add a "criteria"?

Pete


Ofer Cohen said:
The DCount is used to count the number of records in a table or query, to use
it on the group section so it will count for each group, you need to add a
criteria to the DCount for each group.

Or try
=Count(*)

In the Control source of the text box in the group section
 
G

Guest

First - no I skipped =Count(*) - just couldn't see how it could extract my
codes cos don't understand.

I will try your extra criteria which I understand now but its getting a bit
cumbersome! - I need to count about 20 different codes.

Thanks for your patience

Pete

Ofer Cohen said:
First, did you try

=Count(*)

=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' ")
Will return the same report where ever you use it

You need to add another criteria to the field that makes the group
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' And [FieldOfGroup]=" &
[FieldOf Group])

If that field is text and not numeric add single quote, try
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' And [FieldOfGroup]='" &
[FieldOf Group] & "'")


--
Good Luck
BS"D


Pete Rothery said:
Hi Ofer
Thanks for quick response but i am too thick to understand, this is what I
have in the control source
=DCount("[Endpoint3]","Codes ","[Endpoint3] = 'WD' ")
So how do I add a "criteria"?

Pete


Ofer Cohen said:
The DCount is used to count the number of records in a table or query, to use
it on the group section so it will count for each group, you need to add a
criteria to the DCount for each group.

Or try
=Count(*)

In the Control source of the text box in the group section
--
Good Luck
BS"D


:

I have used DCount in a report footer AOK and want to use it in a group
footer. The result is the count for the whole report not the group. Is this
not allowed or am i missing something?

Help its driving me mad!
Pete
 

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