Counts of different values in a field

  • Thread starter Thread starter Jeff Mesch
  • Start date Start date
J

Jeff Mesch

I've got a table with contact information (phone, address, etc) on a
number of people, and just need to get a report that displays the
total number of people in each state. Basically a report that says
"from table y, there are ___ people from Alaska ... there are _____
people Wyoming".

In the contact info table, there is a "state" field, so I'm assuming
it is as simple as a little comparison and counter. I'm just not
familiar enough with Access to come up with the code. If it can be
done with a simple expression, that's even better.

Thanks.

->Jeff
 
Jeff Mesch said:
I've got a table with contact information (phone, address, etc) on a
number of people, and just need to get a report that displays the
total number of people in each state. Basically a report that says
"from table y, there are ___ people from Alaska ... there are _____
people Wyoming".

In the contact info table, there is a "state" field, so I'm assuming
it is as simple as a little comparison and counter. I'm just not
familiar enough with Access to come up with the code. If it can be
done with a simple expression, that's even better.

Code is not required... you need to base your report on a Totals Query....

In the Query Builder, set your table as the data source, then on the menu,
View | Totals. Another line will open up beneath the Fields... drag down
State, and set that other line to "Group By", drag down another field that
will exist in each record, and set that other line to "Count". Run the
Query... you should see State, and the number of records for that state. If
you use that Totals Query as the RecordSource for your Report, you can
present the data you describe with formatting and headings of your choice.

Larry Linson
Microsoft Access MVP
 
Back
Top