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

Detail Counts

Status
Not open for further replies.

hermit22

Programmer
Jul 25, 2001
11
US
I have a very simple problem, but one that is nonetheless very annoying. I would greatly appreciate any assistance anyone could offer.

I have a simple query-based report - no sub-reports or anything. I perform report-level grouping. What I want to do is count the number of records in each detail, and, at the end of the report, provide a count of the total number of records. I selected two fields. In one [ID], I set the RunningSum property to "Over Group" and created a textbox in the group footer that reads =Count([ID]).

In the other [Name], I set the RunningSum property to "Over all" and created a textbox in the report footer that reads =Count([Name]).

The problem is that the group counts are reporting only a running count and not resetting after each new group.

Any ideas?
 
hermit22,

Dont know about your problem. If I want to to create a count by group I would simply create a text box in the group footer and set its control source = Count([AField])
that would give me the total of each group, I would not touch the running sum which by default is no.

Similarly if I wanted a count of total I would create text box and set its control source = Count([Afield2]). Once again by default the running sum is No.

So set the running sum to No on both of your fields.

Mordja
 
Mordja,

Thanks for responding so quickly.

Unfortunately, the first thing I tried was with the Running Sum set to No, but it had kept the running total across groups. In other similar reports it seemed to work with that change to running sum.

Is there some other report setting I'm missing?
 
Hermit22 is correct. It sounds like you simply want counts in group and report footers. However, if you are attempting to put counts in a PAGE FOOTER, you may need to use some running sum stuff.

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]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
I have a slightly different query on this - i have set up the counts which work fine by setting the textbox control source to:
=Count([Coin Mech No])

But, what i need to do is count the Coin Mech No's which have an "R" in the string's.

Tried this

=Count([Coin Mech No] Like "*R*")

Not too sure what syntax goes in the box, any ideas?

Alex
 
Try
=Sum(Abs(Instr([Coin Mech No], "R")>0))

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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top