Counting Fields with Data

  • Thread starter Thread starter Kat3n
  • Start date Start date
K

Kat3n

I have a report with 2 columns consisting of 6 fields each in the detail of a
report. I want a total at the bottom of the columns counting only the fields
with data. How can I do this?
 
If the field is named F1, place a text box in the Report Footer section, and
set its Control Source property to:
=Count([F1])

Access skips nulls when counting or averaging.
 
Sorry, I don't understand. This is what it looks like:
F1
F2
F3
F4
F5
F6
------
"Total"
I want to add a "Total" text box that will count fields F1 thru F6 that have
data entered in them.
I've tried: =Count([F1]&[F2]&[F3]&[F4]&[F5]&[F6]) and
=Count([F1]+[F2]+[F3]+[F4]+[F5]+[F6])
Neither worked.
--
Kat3n


Allen Browne said:
If the field is named F1, place a text box in the Report Footer section, and
set its Control Source property to:
=Count([F1])

Access skips nulls when counting or averaging.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Kat3n said:
I have a report with 2 columns consisting of 6 fields each in the detail of
a
report. I want a total at the bottom of the columns counting only the
fields
with data. How can I do this?
 
How about something like the following. That should give you a count of
non-null values for each field and then add the count for each field.

=Count(F1) + Count(F2) + ... + Count(F6)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Excellent! Thanks so much for your help!
--
Kat3n


John Spencer said:
How about something like the following. That should give you a count of
non-null values for each field and then add the count for each field.

=Count(F1) + Count(F2) + ... + Count(F6)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Sorry, I don't understand. This is what it looks like:
F1
F2
F3
F4
F5
F6
------
"Total"
I want to add a "Total" text box that will count fields F1 thru F6 that have
data entered in them.
I've tried: =Count([F1]&[F2]&[F3]&[F4]&[F5]&[F6]) and
=Count([F1]+[F2]+[F3]+[F4]+[F5]+[F6])
Neither worked.
 
Back
Top