report total problem

P

Pam

I have field on my report named PayRate, which gets the
rate of pay based on a couple of factors. I have a DaySum
field, which is [payrate]*[units], on each detail line.
This works. I'm trying to get a total for each group (each
employee), and an overall total. When I put a box with =Sum
([payrate]*[units]) in the group footer, and set to
running sum over group, the report ask for the parameter
payrate before running the report. Same for putting the
control in the report footer for overall total.
What is the problem, and how do I get this to work?
TIA-
 
P

Pam

Ok, I do think I said it wrong - payrate is a calculated
control.
So, if Sum is not aware of controls, how do I get a total
for each group and a total for overall based on [payrate]*
[units]?
TIA, again-
-----Original Message-----
Pam said:
I have field on my report named PayRate, which gets the
rate of pay based on a couple of factors. I have a DaySum
field, which is [payrate]*[units], on each detail line.
This works. I'm trying to get a total for each group (each
employee), and an overall total. When I put a box with =Sum
([payrate]*[units]) in the group footer, and set to
running sum over group, the report ask for the parameter
payrate before running the report. Same for putting the
control in the report footer for overall total.


I can't see why you would want to use RunningSum on a text
box with Sum. Normally, a text box would use one or the
other, but not both.

I think the problem is that you're confused about the
meaning of the word Field, the items on a form/report are
Controls. Fields are the columns in a table/query. In your
question, this is important because the aggregate functions
(Count, Sum, etc) only work with fields in the form/report's
record source, they are not aware of controls.

Either use RunningSum or calculate the value of payrate in
the report's record source query and then you could use Sum.
 
M

Marshall Barton

Pam said:
Ok, I do think I said it wrong - payrate is a calculated
control.
So, if Sum is not aware of controls, how do I get a total
for each group and a total for overall based on [payrate]*
[units]?


Create a text box named txtRunAmt in the detail section, set
its Control source expression to =[payrate] * [units] and
set its RunningSum property to Over Group. Then, in the
group footer section a text box with the expression
=txtRunAmt will display the total for the group.

Similarly, a grand total in the report footer section can be
done using another text box in the detail section, this time
with its RunningSum set to Over All.
 

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