Does anyone know how to add up multiple subreport's =[RecordCount]

G

Guest

I have a report with three subreports. All three have a have a text box with
the control source of =[RecordCount]. Now I'd like to total those up and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
D

Duane Hookom

1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of =[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return any
records?
 
G

Guest

Actually it's four subreports on one main report. The Main report is named
"Statistical Report - Type of Audits-Main Report", then there are four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3, total4.
These text boxes are located in the group footer of the report's data.

I tried putting a text box on the main report with the following as a
control source but that gave me a name? error. All of these reports should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2] +
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other Audits]![total4]



Duane Hookom said:
1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of =[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return any
records?

--
Duane Hookom
MS Access MVP

Kaitee said:
I have a report with three subreports. All three have a have a text box
with
the control source of =[RecordCount]. Now I'd like to total those up and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
D

Duane Hookom

If all subreports have data then this might work:
=[Statistical Sub-Report - Type of Audit-Both SSA and FSA].Report![total1]
+ [Statistical Sub-Report - Type of Audit-FSA Only].Report![total2]
+ [Statistical Sub-Report - Type of Audit-SSA Only].Report![total3]
+ [Statistical Sub-Report - Type of Audit-Other Audits].Report![total4]

The above text box might have to be in the same section of the main report
as the subreports.


--
Duane Hookom
MS Access MVP


Kaitee said:
Actually it's four subreports on one main report. The Main report is
named
"Statistical Report - Type of Audits-Main Report", then there are four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3, total4.
These text boxes are located in the group footer of the report's data.

I tried putting a text box on the main report with the following as a
control source but that gave me a name? error. All of these reports
should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and
FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2] +
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other Audits]![total4]



Duane Hookom said:
1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of =[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return any
records?

--
Duane Hookom
MS Access MVP

Kaitee said:
I have a report with three subreports. All three have a have a text box
with
the control source of =[RecordCount]. Now I'd like to total those up
and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
G

Guest

That still gives me the same error as what I tried. (name?) All the
subreports are in the detail section of the main report and that's where I'm
trying to add this. All the subreports have records returned.

Duane Hookom said:
If all subreports have data then this might work:
=[Statistical Sub-Report - Type of Audit-Both SSA and FSA].Report![total1]
+ [Statistical Sub-Report - Type of Audit-FSA Only].Report![total2]
+ [Statistical Sub-Report - Type of Audit-SSA Only].Report![total3]
+ [Statistical Sub-Report - Type of Audit-Other Audits].Report![total4]

The above text box might have to be in the same section of the main report
as the subreports.


--
Duane Hookom
MS Access MVP


Kaitee said:
Actually it's four subreports on one main report. The Main report is
named
"Statistical Report - Type of Audits-Main Report", then there are four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3, total4.
These text boxes are located in the group footer of the report's data.

I tried putting a text box on the main report with the following as a
control source but that gave me a name? error. All of these reports
should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and
FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2] +
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other Audits]![total4]



Duane Hookom said:
1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of =[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return any
records?

--
Duane Hookom
MS Access MVP

I have a report with three subreports. All three have a have a text box
with
the control source of =[RecordCount]. Now I'd like to total those up
and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
D

Duane Hookom

Did you use the actual subreport "control" names or the name of the
subreports? Do you understand the difference? Did you make sure the name of
the text box is not also the name of a field?

--
Duane Hookom
MS Access MVP

Kaitee said:
That still gives me the same error as what I tried. (name?) All the
subreports are in the detail section of the main report and that's where
I'm
trying to add this. All the subreports have records returned.

Duane Hookom said:
If all subreports have data then this might work:
=[Statistical Sub-Report - Type of Audit-Both SSA and
FSA].Report![total1]
+ [Statistical Sub-Report - Type of Audit-FSA Only].Report![total2]
+ [Statistical Sub-Report - Type of Audit-SSA Only].Report![total3]
+ [Statistical Sub-Report - Type of Audit-Other Audits].Report![total4]

The above text box might have to be in the same section of the main
report
as the subreports.


--
Duane Hookom
MS Access MVP


Kaitee said:
Actually it's four subreports on one main report. The Main report is
named
"Statistical Report - Type of Audits-Main Report", then there are four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3,
total4.
These text boxes are located in the group footer of the report's data.

I tried putting a text box on the main report with the following as a
control source but that gave me a name? error. All of these reports
should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and
FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2] +
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other Audits]![total4]



:

1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of
=[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return
any
records?

--
Duane Hookom
MS Access MVP

I have a report with three subreports. All three have a have a text
box
with
the control source of =[RecordCount]. Now I'd like to total those
up
and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
G

Guest

I think I understand that the control name is the name of the subreport in
the designview of the main report. Correct me if I'm wrong because I am new
to this.

Now I changed the names to match the control names of the subreports. This
made the name? error go away but the number is definitely incorrect. The
fields I'm trying to add up are all a larger number than the result I'm
given, which is the exact number of fields I'm trying to add(4).

Here is the code I used:
=[Statistical Report - Type of Audit-FSA Only].Report![total1] +
[Child23].Report![total2] + [Statistical Report - Type of Audit-SSA
Only].Report![total3] + [Statistical Report - Type of Audit-Other
Audits].Report![total4]



Duane Hookom said:
Did you use the actual subreport "control" names or the name of the
subreports? Do you understand the difference? Did you make sure the name of
the text box is not also the name of a field?

--
Duane Hookom
MS Access MVP

Kaitee said:
That still gives me the same error as what I tried. (name?) All the
subreports are in the detail section of the main report and that's where
I'm
trying to add this. All the subreports have records returned.

Duane Hookom said:
If all subreports have data then this might work:
=[Statistical Sub-Report - Type of Audit-Both SSA and
FSA].Report![total1]
+ [Statistical Sub-Report - Type of Audit-FSA Only].Report![total2]
+ [Statistical Sub-Report - Type of Audit-SSA Only].Report![total3]
+ [Statistical Sub-Report - Type of Audit-Other Audits].Report![total4]

The above text box might have to be in the same section of the main
report
as the subreports.


--
Duane Hookom
MS Access MVP


Actually it's four subreports on one main report. The Main report is
named
"Statistical Report - Type of Audits-Main Report", then there are four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3,
total4.
These text boxes are located in the group footer of the report's data.

I tried putting a text box on the main report with the following as a
control source but that gave me a name? error. All of these reports
should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and
FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2] +
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other Audits]![total4]



:

1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of
=[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not return
any
records?

--
Duane Hookom
MS Access MVP

I have a report with three subreports. All three have a have a text
box
with
the control source of =[RecordCount]. Now I'd like to total those
up
and
place them in a text box on the Parent report. However, I'm having
difficulty with this.
 
D

Duane Hookom

Trouble-shoot by simplifying and testing. Try a text box with only:
=[Statistical Report - Type of Audit-FSA Only].Report![total1]
Is this number correct? Are the "Total.." text boxes in the report footer of
the subreports?

--
Duane Hookom
MS Access MVP

Kaitee said:
I think I understand that the control name is the name of the subreport in
the designview of the main report. Correct me if I'm wrong because I am
new
to this.

Now I changed the names to match the control names of the subreports.
This
made the name? error go away but the number is definitely incorrect. The
fields I'm trying to add up are all a larger number than the result I'm
given, which is the exact number of fields I'm trying to add(4).

Here is the code I used:
=[Statistical Report - Type of Audit-FSA Only].Report![total1] +
[Child23].Report![total2] + [Statistical Report - Type of Audit-SSA
Only].Report![total3] + [Statistical Report - Type of Audit-Other
Audits].Report![total4]



Duane Hookom said:
Did you use the actual subreport "control" names or the name of the
subreports? Do you understand the difference? Did you make sure the name
of
the text box is not also the name of a field?

--
Duane Hookom
MS Access MVP

Kaitee said:
That still gives me the same error as what I tried. (name?) All the
subreports are in the detail section of the main report and that's
where
I'm
trying to add this. All the subreports have records returned.

:

If all subreports have data then this might work:
=[Statistical Sub-Report - Type of Audit-Both SSA and
FSA].Report![total1]
+ [Statistical Sub-Report - Type of Audit-FSA Only].Report![total2]
+ [Statistical Sub-Report - Type of Audit-SSA Only].Report![total3]
+ [Statistical Sub-Report - Type of Audit-Other
Audits].Report![total4]

The above text box might have to be in the same section of the main
report
as the subreports.


--
Duane Hookom
MS Access MVP


Actually it's four subreports on one main report. The Main report
is
named
"Statistical Report - Type of Audits-Main Report", then there are
four
subreports named:
Statistical Sub-Report - Type of Audit-Both SSA and FSA
Statistical Sub-Report - Type of Audit-FSA Only
Statistical Sub-Report - Type of Audit-Other Audits
Statistical Sub-Report - Type of Audit-SSA Only
each of these reports have a text box with the control source of
=[RecordCount]. The text boxes are named total1, total2, total3,
total4.
These text boxes are located in the group footer of the report's
data.

I tried putting a text box on the main report with the following as
a
control source but that gave me a name? error. All of these reports
should
return records.

= Reports![Statistical Sub-Report - Type of Audit-Both SSA and
FSA]![total1]
+ Reports![Statistical Sub-Report - Type of Audit-FSA Only]![total2]
+
Reports![Statistical Sub-Report - Type of Audit-SSA Only]![total3] +
Reports![Statistical Sub-Report - Type of Audit-Other
Audits]![total4]



:

1) What expression did you try?
2) What were your results?
3) Do you have some subreport names?
4) What is the name of control with the control source of
=[RecordCount]?
5) What section of the subreport is this control located in?
6) Is it possible that one or more of the subreports might not
return
any
records?

--
Duane Hookom
MS Access MVP

I have a report with three subreports. All three have a have a
text
box
with
the control source of =[RecordCount]. Now I'd like to total
those
up
and
place them in a text box on the Parent report. However, I'm
having
difficulty with this.
 

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