=Count error

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi group, I'm trying to calculate how many people are on a course and
produce this number on the bottom of a report.

I've tried =Count([name]) as the control source of the text box. However
the txtbox displays error.

Please help
 
Chris,

Are you putting this in the Footer section of the report? Most likely
the name of the textbox is the same as the field it is referring to in
the calculation?

Try it like this...
=Count(*)

By the way, note that Name is a Reserved Word (i.e. has a special
meaning) in Access, and as such should not be used as the name of a
field or control or database object.
 
If you are trying to count the number of entries in a table or query you can
use the Dcount function. Just use
=DCount("[field name]","Query/Table Name","expression")

This will count up all the values in that field where the expression is
true. If you want to count them all then just have the expression constant
true like "1>0".

Keith
 
Doh! I put it in the page footer instead of the report footer. Thanks for
setting me straight.
Steve Schapel said:
Chris,

Are you putting this in the Footer section of the report? Most likely
the name of the textbox is the same as the field it is referring to in
the calculation?

Try it like this...
=Count(*)

By the way, note that Name is a Reserved Word (i.e. has a special
meaning) in Access, and as such should not be used as the name of a
field or control or database object.

--
Steve Schapel, Microsoft Access MVP

Hi group, I'm trying to calculate how many people are on a course and
produce this number on the bottom of a report.

I've tried =Count([name]) as the control source of the text box. However
the txtbox displays error.

Please help
 
Back
Top