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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting records in a report 1

Status
Not open for further replies.

Cillies

Technical User
Feb 7, 2003
112
GB
Hi! all.

I have a report and I want to show the number of occurances of a particular value that appears in the report.

The thing is that the value that I want to count in the report comes from a combo box value list. in this list I have certain values like "send letter", "sent email" and I want to show at the bottom of my report how many times they appear on the report.

Thanks
 
Cillies
One method would be to put an unbound text box in your Detail section. The expression in the text box would be...

IIf([TheTextBoxThatHoldsTheComboBoxValue]="send letter",1,0)

Make that text box a Running Sum OverAll

Then in the report footer, reference that text box with another unbound text box that has the control source...
=([YourTextBox])

You can make the unbound text box in the Detail section invisible so that it doesn't print in the report.

Tom
 
If you want to show counts for each of the "certain values" in the report footer, consider using a subreport that is based on a totals query.

If you just want a count where FieldA equals "Send Letter", use a text box with a control source of:
=Sum( Abs([FieldA] = "Send Letter") )

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks dhookom, works like a charm. I have managed to use multiples of this to combine various values under the same count.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top