Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting in an Access Report 1

Status
Not open for further replies.

Tiggerohio

Technical User
Sep 15, 2003
9
US
I am trying to count detail records in a report. I have created a group footer for what I want to count and used =Count(*) which created a count of 1 under each item. This is what I am trying to do
Zipcode Directory
44907 Directory 1
Directory 2
Directory 3
Total Directories 3

Thanks for the help
 
Look at the DCount method instead and see if that will work better.
 
Hi-
I'm pretty much self taught with Access and could not find the DCount command/expression. Could you help with that?
Thanks
 
It is a conditional count statement used to count records. Here is the syntax:

DCount(expr, domain[, criteria])

where expr is the field/control/etc. that you want to count, domain is the table/query, and criteria is the condition on which to count. For example, the following:

DCount("*","myTable","Zipcode = 44907")

would coult all the records in myTable where Zipcode = 44907. If you want more detail, go to Access Help and search for DCount.

--Brad
 
I have close to 700 different zipcodes. I just wanted to total the number of directories for each zipcode.
Thanks
 
Try =Count([Directory])

that is if the field name is Directory. This of course will only count them if there is data in the field [Directory]. You need to make sure you use a field that will always have data in it for each record to get a record count.

Hope this helps.

OnTheFly
 
Tried that one too. Recieved the same result as =Count(*).

This is what I'm trying to do. Went to Microsoft for help as well, and I guess I'm not at the same level they are, we are having a difficult time understanding one another.
This is what I have and what I want it to do. This is how the report is set up (I am not including the labels) -

ZIP HEADER
Zip Clients
DETAIL
dir_name Bookcode state Price CostperClient
DIR_NAME FOOTER
=Count(*) {have also used =Count[dir_name] and have changed the footer to be Zip}
PAGE FOOTER
-----------------------------------------------------------
zip = is the zipcode
dir_name = name of telephone directory
Bookcode = numerical code for telephone directory
state = state the directory is in
clients = how many clients came from that zipcode
Price = advertising $ amount by telephone directory
CostperClient = need to divide the number of clients into the number of directories and then that amount divided by the Price of the directory (not sure how this will be done, since I do not have the directory count).

This is what I want as a result -

ZipCode 99999 Clients 6
Directory Name Bookcode State Price CostperClient
Directory A 111111 OH $1,000.00 $500.00
Directory B 222222 OH $ 200.00 $200.00
Directory C 333333 OH $ 300.00 $150.00
Total Directories: 3
Currently when I have =Count(*) in the dir_name Footer, the value placed underneath each directory is 1.
Maybe I'm trying to do too much in the report, and should try to create a query or table?
I didn't realize I would have so much trouble with this.
 
You need to put your =Count(Dir_Name) in the Zip Footer.

Hope this helps.

OnTheFly
 
Tried that, and received the same results.
I must have something set wrong?
 
Try putting the =Count(Dir_Name) in a text box in the Zip Header and see if you get the right count.

Hope this helps.

OnTheFly
 
OnTheFly-
THANK YOU THANK YOU!!
I can not believe it was so easy, and the people at MicroSoft evidently have no clue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top