adding counters

  • Thread starter Thread starter peg
  • Start date Start date
P

peg

I have run into an odd problem, in my report I have to 2 subtotals - one for
each grouping. my first grouping counter works fine - which is the 1st
grouping in which I add the "RecordCounter" =1 and do a sum over group, then
set the total for the grouping equal to that.

My next one is the one I'm having problems with..... I used a variable and
onformat of each detail record I was incrementing the 2nd grand total, and
then resetting the total on that groupings header.

Here is the problem I've run into.....
I set a textbox visible in the detail so I could see the sequential
incrementing within the out grouping, when it goes onto a new page it jumps
up by usually 2.

So for example at the bottom of my 1st page the group sumtotal is 24, next
page its 26, which is of course throwing off my totals.

I also tried it to set to 2nd grouping total equal to itself plus the value
of the 1st grouping in the format of the 1st grouping footer. Doing it this
way I found it kept adding the 1st grouping total on a new page even tho the
grouping wasn't over (or had the footer showing).

ANY help would be of great assistance - I'm ready to pull my hair out!!!

Peg
 
peg said:
I have run into an odd problem, in my report I have to 2 subtotals - one for
each grouping. my first grouping counter works fine - which is the 1st
grouping in which I add the "RecordCounter" =1 and do a sum over group, then
set the total for the grouping equal to that.

My next one is the one I'm having problems with..... I used a variable and
onformat of each detail record I was incrementing the 2nd grand total, and
then resetting the total on that groupings header.

Here is the problem I've run into.....
I set a textbox visible in the detail so I could see the sequential
incrementing within the out grouping, when it goes onto a new page it jumps
up by usually 2.

So for example at the bottom of my 1st page the group sumtotal is 24, next
page its 26, which is of course throwing off my totals.

I also tried it to set to 2nd grouping total equal to itself plus the value
of the 1st grouping in the format of the 1st grouping footer. Doing it this
way I found it kept adding the 1st grouping total on a new page even tho the
grouping wasn't over (or had the footer showing).


You can not reliable calculate totals using code in event
procedures. The Format (and Print) event procedure is not
triggered in a sequential order and may be executed more
than once as KeepTogether, etc. cause retreats and
reformatting.

If you can not use a simple aggregate function on an
expression consisting of record source fields, then use a
text box with its RunningSum property.
 
Back
Top