Group Calculations and "repeat Section"

G

Guest

I have a bunch of simple calculations, based on the grouping of items in a
report.
There is a grup header and footer. The foot contains a total count of
detail records and subsets of various criteria and calculated percentages.
My problem is that some of the groups span multiple pages and I have the
"repeat section" set to yes in the Group header. My calculations only seem
to work when the group is on one page anything over a page only calculates on
the details contained on the last page with a group header. The group header
has code behind which resets all the variables back to zero.

Ideas? Suggestions?
 
L

Larry Linson

I have a bunch of simple calculations,
based on the grouping of items in a
report. There is a grup header and
footer. The foot contains a total count
of detail records and subsets of various
criteria and calculated percentages.
My problem is that some of the groups
span multiple pages and I have the
"repeat section" set to yes in the Group
header. My calculations only seem
to work when the group is on one page
anything over a page only calculates on
the details contained on the last page with
a group header. The group header has
code behind which resets all the variables
back to zero.

It seems to me that you are going to have to redesign your calculations so
that the header does not reset the values to zero when it prints on each
page because of the repeat factor, or you are going to have to eliminate the
repeat factor, or you are going to have to obtain the results in another
way.

Perhaps you could reset the values in the Footer, or only when the value on
which you are grouping changes, if your calculations must be done in code as
you have them now, but...

Because the firing of events is difficult to predict, I try to avoid doing
calculations in event code. When possible I use calculated Fields in the
Query that is RecordSource for the Report, or calculated Controls within the
Report itself.

Larry Linson
Microsoft Access 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