Counting records in a group for a report.

G

Gil Grissom

I followed the instructions in Help entitled "Count the number of
records in each group or report." However, instead of getting the
total, I am getting just the number 1. If I change the value in the
Control Source field to 2, then I get 2, etc.

Why doesn't this work? Is it a misprint in the help file? I pasted
the instructions below.

For Step 4, I wasn't clear on where the "group footer" is so I put it
in the page footer. However, this won't give me the total for groups
that span multiple pages.

-----------------------------------------------------------------

1) Open the report in Design view (Design view: A window that shows
the design of these database objects: tables, queries, forms, reports,
macros, and data access pages. In Design view, you can create new
database objects and modify the design of existing ones.).
2) Do one or both of the following:

Count the number of records in a group

1) Click the Text Box tool on the toolbox (toolbox: A set of tools
that is available in Design view to add controls to a form, report, or
data access page. The toolset available in page Design view is
different from the toolset available in form and report Design view.)
and click the detail section (detail section: Used to contain the main
body of a form or report. This section usually contains controls bound
to the fields in the record source but can also contain unbound
controls, such as labels that identify a field's contents.). The
control (control: A graphical user interface object, such as a text
box, check box, scroll bar, or command button, that lets users control
the program. You use controls to display data or choices, perform an
action, or make the user interface easier to read.) will not be visible
to the user, so its placement within the section is not critical.

2) Select the text box and click Properties on the toolbar.

3) Set the following properties. Property Setting
Name A text string, such as RecordCount
ControlSource =1
RunningSum Over Group
Visible No

4) Add a text box to the group footer (group footer: Used to place
information, such as group name or group total, at the end of a group
of records.).

5) Select the text box, and then click Properties on the toolbar.

6) Set the ControlSource property to the name of the control in the
detail section that's tracking the running total; for example,
=[RecordCount]
 
G

Gil Grissom

Ok, so, I figured out where the Group Footer setting was hiding. By
default, it is turned off. To turn it on, you have to go into the
Sorting and Grouping properties.

I still need some help with the proper counting algorithm for Control
Source. TIA
 
G

Gil Grissom

Ok, so, Nevermind again. I accidently put the counter field in the
Group Header instead of the Detail section. Duh!!
 
J

John Vinson

Ok, so, I figured out where the Group Footer setting was hiding. By
default, it is turned off. To turn it on, you have to go into the
Sorting and Grouping properties.

I still need some help with the proper counting algorithm for Control
Source. TIA

A control source of =Count(*) will count the records in the group. No
algorithm, (1), or code is required.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top