Easy Count Question

S

SITCFanTN

I'm creating a report and want to count the number of cells with currency in
the column called Downpay. In my control source I'm using this criteria but
keep getting an error value, any ideas on how I can count these. I don't
want a sum, I just want a count. Thanks for your help.

=Count([Downpay])
 
S

Stefan Hoffmann [MVP]

hi,
I'm creating a report and want to count the number of cells with currency in
the column called Downpay.
This sounds wrong. Can you give us an example including data?
=Count([Downpay])
Take a look at DCount() in the OH.


mfG
--> stefan <--
 
S

SITCFanTN

What do you mean by OH please?

Stefan Hoffmann said:
hi,
I'm creating a report and want to count the number of cells with currency in
the column called Downpay.
This sounds wrong. Can you give us an example including data?
=Count([Downpay])
Take a look at DCount() in the OH.


mfG
--> stefan <--
 
M

Marshall Barton

SITCFanTN said:
I'm creating a report and want to count the number of cells with currency in
the column called Downpay. In my control source I'm using this criteria but
keep getting an error value, any ideas on how I can count these. I don't
want a sum, I just want a count. Thanks for your help.

=Count([Downpay])


The aggregate function do not operate on controls, only
fields.

Make sure that you are using the name of the field in the
report's record source table/query.
 
S

SITCFanTN

I'm new at this and just not sure what you are trying to tell me. When I run
my query, it runs perfectly. I'm generating my report from that query and I
just can't seem to get a count. My field name is Downpay, I'm putting this
in the detail part of the report, is that the issue. I know this is easy, I
just can't figure out what is wrong. Thanks again for your help.

Marshall Barton said:
SITCFanTN said:
I'm creating a report and want to count the number of cells with currency in
the column called Downpay. In my control source I'm using this criteria but
keep getting an error value, any ideas on how I can count these. I don't
want a sum, I just want a count. Thanks for your help.

=Count([Downpay])


The aggregate function do not operate on controls, only
fields.

Make sure that you are using the name of the field in the
report's record source table/query.
 
M

Marshall Barton

I'm questioning if you are using the word "field"
ambiguously. A FIELD is a column in a table/query. The
thingies on a form/report are CONTROLs. Since a control is
often used to display the value of a field, they are often
confused.

This issue can be even more confusing because Access often
assigns the name of a control to be the same as the name of
the field it is displaying. OTOH, there is no requirement
that the control name be the same as a field name and most
of the time it is best to make sure they are different.

With all that in mind, the aggregate functions (Count,Sum,
etc) can only operate on fields and are unaware of controls.
So, when you use a text box expression like:
=Count(xxxx)
you need to make sure that xxxx is the name of a **field**
and not the name of a control.

An exception to this is if you wnt to count every record
whether any or its fields is Null or not. In this special
case, you would use the expression =Count(*)

Finally, counting a detail doesn't make much sense.
Normally you want to count a group or the entire report, so
the count text box should be in a group header/footer
section and/or the report header/footer (not in the page
sections).
--
Marsh
MVP [MS Access]

I'm new at this and just not sure what you are trying to tell me. When I run
my query, it runs perfectly. I'm generating my report from that query and I
just can't seem to get a count. My field name is Downpay, I'm putting this
in the detail part of the report, is that the issue. I know this is easy, I
just can't figure out what is wrong. Thanks again for your help.

Marshall Barton said:
SITCFanTN said:
I'm creating a report and want to count the number of cells with currency in
the column called Downpay. In my control source I'm using this criteria but
keep getting an error value, any ideas on how I can count these. I don't
want a sum, I just want a count. Thanks for your help.

=Count([Downpay])


The aggregate function do not operate on controls, only
fields.

Make sure that you are using the name of the field in the
report's record source table/query.
 

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