Group events

S

Sam Hobbs

I need to summarize a field for a group footer. This report, however, does
not use detail lines; it consists entirely of three groups. I assume that
the absence of a detail line is causing the usual group footer total
mechanism to not work. However just to be sure, I will explain what I did
that did not work.

Just to be sure I amusing the correct terminology, the most infrequent group
is level 0. The next is level 1 and the most frequent level, that appears on
the report to be thje detail level, is level 2.

In level 1, we have the calculation "cost * quantity". We need to summarize
that value for the level 0. I add a textbox to the level 0 footer and set
the control source to "cost * quantity". It does not summarize the values,
whether or not I set the Running Sum to "Over Group"

I assume the problem is a lack of a detail line. So I have tried to use the
"On Print" event to calulate the total. In the "On Print" event for the
level 0 header, I set the text box in the level 0 footer to zero. In the
level 1 header, I acummulate the "cost * quantity". That is, I add the level
1 value to the level 0 footer text box. This does not work either. No matter
what I try, I always get the value from ither the first or the last level 1
(group) line.

This is something that should be easy, but I don't know what Access is doing
so I don't understand how I should make it work.
 
D

Duane Hookom

Are you using an equal sign?
=[cost]*[Quantity]
If you have these two fields in your report's record source, this expression
should work in all group headers and footers.
 
M

Marshall Barton

Sam said:
I need to summarize a field for a group footer. This report, however, does
not use detail lines; it consists entirely of three groups. I assume that
the absence of a detail line is causing the usual group footer total
mechanism to not work. However just to be sure, I will explain what I did
that did not work.

Just to be sure I amusing the correct terminology, the most infrequent group
is level 0. The next is level 1 and the most frequent level, that appears on
the report to be thje detail level, is level 2.

In level 1, we have the calculation "cost * quantity". We need to summarize
that value for the level 0. I add a textbox to the level 0 footer and set
the control source to "cost * quantity". It does not summarize the values,
whether or not I set the Running Sum to "Over Group"

I assume the problem is a lack of a detail line. So I have tried to use the
"On Print" event to calulate the total. In the "On Print" event for the
level 0 header, I set the text box in the level 0 footer to zero. In the
level 1 header, I acummulate the "cost * quantity". That is, I add the level
1 value to the level 0 footer text box. This does not work either. No matter
what I try, I always get the value from ither the first or the last level 1
(group) line.


I don't think I followed all that, but it seems like you can
just use the expression:

=Sum(Cost * Quantity)

in any of the footer ections
 
S

Sam Hobbs

Thank you. I know that but I have been working on this in bits and peices
over a period of time and just forgot about the "=". It is very simple but I
forgot it.
 
S

Sam Hobbs

Marshall Barton said:
I don't think I followed all that, but it seems like you can
just use the expression:

=Sum(Cost * Quantity)

in any of the footer ections


Thank you. I am sorry I wrote so much.

Yes, that would work. Except in this situation, there are also duplicate
records. I did not explain that and I won't try to; your answer above
certainly answers my question as I stated it. It is working, except for the
additional problem of duplicate records. So now I need to make an additional
query to remove duplicates and expect to be able to do that in a few minutes
(hopefully less than a few hours).
 
S

Sam Hobbs

Marshall Barton said:
I don't think I followed all that, but it seems like you can
just use the expression:

=Sum(Cost * Quantity)

in any of the footer ections


Thank you again. The problem I was having was caused by something else. When
I discovered that problem everything else was easy.
 

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