How do I count a counted field.

R

Robin Chapple

I have a report listing members counted per country.

=Count([Country]) & IIf(Count([Country])=1," member in "," members
in ") & [Country]

This text box is named [Counted]

In the footer I added a text box with this:

=Count([Counted])

with the #Name? error

What have I done wrong?

Is there a way to "Count Unique [Country]" ?

Thanks,

Robin Chapple
 
T

Tom Lake

=Count([Country]) & IIf(Count([Country])=1," member in "," members
in ") & [Country]

This text box is named [Counted]

In the footer I added a text box with this:

=Count([Counted])

with the #Name? error

What have I done wrong?

You can't have a function on a calculated field. Try:

=Count([Country]) & IIf(Count([Country])=1," member in"," members in") & "
all countries"

Tom Lake
 
M

MacDermott

There are a number of ways to do this; here's one:
Put a textbox in your detail section - or in the header where you have
[Counted].
I'll call it txtRunningSum.
Set its ControlSource like this:
=1
Set its RunningSum property to Over All.
This textbox should read 1 for the first country, 2 for the second, and so
on.
Once you've confirmed that it's really doing that, you can make it invisible
if you like.

Now put another textbox in the Report Footer.
I'll call it txtTotalSum
Set its ControlSource like this:
=[txtRunningSum]
It should show the value of txtRunningSum from the last record -
which I think is what you want.

HTH
- Turtle
 
R

Robin Chapple

Tom,

That gives "#Error" message.

Robin

=Count([Country]) & IIf(Count([Country])=1," member in "," members
in ") & [Country]

This text box is named [Counted]

In the footer I added a text box with this:

=Count([Counted])

with the #Name? error

What have I done wrong?

You can't have a function on a calculated field. Try:

=Count([Country]) & IIf(Count([Country])=1," member in"," members in") & "
all countries"

Tom Lake
 
R

Robin Chapple

Turtle,

That was very easy to follow your instructions and it worked first
time. I would never have got there by myself.

Many thanks,

Robin Chapple


There are a number of ways to do this; here's one:
Put a textbox in your detail section - or in the header where you have
[Counted].
I'll call it txtRunningSum.
Set its ControlSource like this:
=1
Set its RunningSum property to Over All.
This textbox should read 1 for the first country, 2 for the second, and so
on.
Once you've confirmed that it's really doing that, you can make it invisible
if you like.

Now put another textbox in the Report Footer.
I'll call it txtTotalSum
Set its ControlSource like this:
=[txtRunningSum]
It should show the value of txtRunningSum from the last record -
which I think is what you want.

HTH
- Turtle

Robin Chapple said:
I have a report listing members counted per country.

=Count([Country]) & IIf(Count([Country])=1," member in "," members
in ") & [Country]

This text box is named [Counted]

In the footer I added a text box with this:

=Count([Counted])

with the #Name? error

What have I done wrong?

Is there a way to "Count Unique [Country]" ?

Thanks,

Robin Chapple
 

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