URGENT: Problems With Totals

  • Thread starter Thread starter pr1357
  • Start date Start date
P

pr1357

Hello, I'm having problems creating the total for a report I created
Before anything please forgive any wrong feature names I use, th
access I have is not in english, I will try to make as clear a
possible.

I created a report and for some fields I set the "hide othe
occurences" option, from the properties window. One of these fields i
a "Client Code" field. At the end of my report I must have a tota
(that is actually how many clients are listed). I did this by creatin
a "text box" and atributing to it a value with "Count([ClientCode])".
The problem is that some clents appear more then once in this report
an although the "hide other ocurences" atribute makes the othe
ocurences invisible in the report, they actually exist and are bein
counted with this method I used. So if I have 2 clients listed but on
of them has 3 ocurences, for exemple, I'm getting a total of 4 and no
2 as I should be getting.

How can I create this total field I need? Any ideas are welcome, an
thank you in advance
 
If you are sorting/grouping by ClientCode then you can add a text box to the
group header:
Name: txtCountCC
Control Source: =1
Running Sum: Over All
Then in the report footer, add a text box:
Control Source: =txtCountCC

If you aren't sorting by ClientCode then you may need to create a groupby
query that groups by ClientCode. Use this query to create another query that
counts the number of unique ClientCodes. This should create only one record.
You can then add this query to your report's record source or grab the value
using DLookup()
 
Back
Top