Totaling an average.

  • Thread starter Thread starter Shipp
  • Start date Start date
S

Shipp

I have a report that is broken down by customer. In the
customer footer I have an average of the sales volume. I
would like a total of these averages in the report footer.
Any help would be greatly appreciated.
 
You need two event procedures and a module level variable
to hold the total.

In the property sheet for the group footer, select the On
Print event, then pick the Code Builder. This will create
an empty event procedure, which needs just one line:

lngSumOfAverate = lngSumOfAverate + me.txtAverage.Value

In the above snippet, txtAverage is the Name of the
control in the group footer that contains the average.

In the Declarations section for the module, add the
following statement.

Dim lngSumOfAverate as Long

Next, create a Report Footer procedure in the same manner.
It needs just a single line.

Me.TotalOfAverages = lngSumOfAverate

That should do it.

Kind regards,
David Gray
P6 Consulting
http://www.p6c.com/
 
Back
Top