Using Calculated Fields in Report Footers

D

David

Hello,

I've been reading the various responses to the question of how to use a
calculated field in a report footer. I think I've done what I've read, but
with no luck...

I have a text box in section footer1 called T1YESTxt, with the data source
of =IIf([T1TOT]>=([PayGap]*80),1,0). Format is STANDARD, 0 decimal places.
This works fine.

I have another text box in section footer1 called T1YESNum, with the data
source of: T1YESTxt.

In section footer2, I am trying to either do a SUM of T1YESNum, to no avail.
(Access presents me a dialog box asking for me to enter the value of T1YESNum.

Any ideas?

--David
 
M

Marshall Barton

David said:
I've been reading the various responses to the question of how to use a
calculated field in a report footer. I think I've done what I've read, but
with no luck...

I have a text box in section footer1 called T1YESTxt, with the data source
of =IIf([T1TOT]>=([PayGap]*80),1,0). Format is STANDARD, 0 decimal places.
This works fine.

I have another text box in section footer1 called T1YESNum, with the data
source of: T1YESTxt.

In section footer2, I am trying to either do a SUM of T1YESNum, to no avail.
(Access presents me a dialog box asking for me to enter the value of T1YESNum.


The Sum function only operates on fields in the
form/report's record source table/query. Use the field name
instead of the text box name:
=Sum(T1YESTxt)
 
D

David

Well,

I am creating the field Y1YESTxt in the report footer1. I.e. It is a
calculated field.

So, Access really can't sum a field created in the report, huh?
--
David


Marshall Barton said:
David said:
I've been reading the various responses to the question of how to use a
calculated field in a report footer. I think I've done what I've read, but
with no luck...

I have a text box in section footer1 called T1YESTxt, with the data source
of =IIf([T1TOT]>=([PayGap]*80),1,0). Format is STANDARD, 0 decimal places.
This works fine.

I have another text box in section footer1 called T1YESNum, with the data
source of: T1YESTxt.

In section footer2, I am trying to either do a SUM of T1YESNum, to no avail.
(Access presents me a dialog box asking for me to enter the value of T1YESNum.


The Sum function only operates on fields in the
form/report's record source table/query. Use the field name
instead of the text box name:
=Sum(T1YESTxt)
 
M

Marshall Barton

David said:
I am creating the field Y1YESTxt in the report footer1. I.e. It is a
calculated field.

So, Access really can't sum a field created in the report, huh?


That would not be a field. A calculated text box is a
**comtrol**. Sum (and all other aggregate functions) on;y
operate on fields, not on controls.

One alternative is to perform the calculation in the
form/report records source query. This is the recommended
way to make a calculated value available to the report
header section.

The other is to use a report text box's RunningSum property.
This usually involves adding another text next to the
calculated text box. Set its control source expression to
refer to the calculated text box and set its RunningSum
property to Over Group. The next higher level of group
footer can then display the totat by referring to the
running sum text box. *** Depending on your version of
Access, a report header text box can refer to a total text
box in the report header ***
 
S

sunshineleo

Marshall,
I tried what you said, but the totals pick only one line item in the details
field. I am trying to use sum with an unbound text box on a report, in one of
the groupings' footers.
Should I be trying something else?
This is exasperating!!! I've tried everything. sum([txtYear1]) , dsum, =,
you name it...
 
M

Marshall Barton

Please try to reply to messages in the same thread.

I really have no idea what you mean by "totals pick only one
line item". I really need more details so I can understand
the problem you are trying to solve. Maybe an example of
some lines in the report would help. If this same problem
as you posted earlier this morning, check to see if my reply
there helps.
--
Marsh
MVP [MS Access]

I tried what you said, but the totals pick only one line item in the details
field. I am trying to use sum with an unbound text box on a report, in one of
the groupings' footers.
Should I be trying something else?
This is exasperating!!! I've tried everything. sum([txtYear1]) , dsum, =,
you name it...

Marshall Barton said:
That would not be a field. A calculated text box is a
**comtrol**. Sum (and all other aggregate functions) on;y
operate on fields, not on controls.

One alternative is to perform the calculation in the
form/report records source query. This is the recommended
way to make a calculated value available to the report
header section.

The other is to use a report text box's RunningSum property.
This usually involves adding another text next to the
calculated text box. Set its control source expression to
refer to the calculated text box and set its RunningSum
property to Over Group. The next higher level of group
footer can then display the totat by referring to the
running sum text box. *** Depending on your version of
Access, a report header text box can refer to a total text
box in the report header ***
 

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