How to get a value from subreport to report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Subreport - rItem
Text Box name - rItemTotals
Control Source - =Sum([PUR_PRI])

Main report - rTotalPrinter2
Text Box name - Text87 (in report footer)
Control Source - =Report!rTotaPrinters2!rItem!rItemTotals (many of
hundreds
of combinations of tries)
I either get "Enter parameter value rTotalPrinters2" or no prompt and
"&Name?" or "#Error"
I've put in about 20 some odd hours just trying to get the result of the
subreport field to display on the main report. It's probably simple but...
Thanks.
 
Try:
=rItem.Report!rItemTotals
This assumes the subreport control (the object on your main report) is named
"rItem". If you are concerned about no records in the subreport, use:
=IIf(rItem.Report.HasData, rItem.Report!rItemTotals,0)
 
Duane,
Sorry but nope. Same thing. It displays "Enter Parameter Value - Item"
(which it has done since the beginning but I can live with that) then "Enter
Parameter Value - rItem" with the result being "&Name?". Anything else?
Thanks.


Duane Hookom said:
Try:
=rItem.Report!rItemTotals
This assumes the subreport control (the object on your main report) is named
"rItem". If you are concerned about no records in the subreport, use:
=IIf(rItem.Report.HasData, rItem.Report!rItemTotals,0)

--
Duane Hookom
MS Access MVP
--

Danh said:
Subreport - rItem
Text Box name - rItemTotals
Control Source - =Sum([PUR_PRI])

Main report - rTotalPrinter2
Text Box name - Text87 (in report footer)
Control Source - =Report!rTotaPrinters2!rItem!rItemTotals (many of
hundreds
of combinations of tries)
I either get "Enter parameter value rTotalPrinters2" or no prompt and
"&Name?" or "#Error"
I've put in about 20 some odd hours just trying to get the result of the
subreport field to display on the main report. It's probably simple
but...
Thanks.
 
Are the text box and the subreport in the same section of the report?

I made an assumption that your subreport *control* name rItem. This is not
always true. A subreport name is not always the same as the name of the
subreport control on the main report. You didn't respond to this assumption
so I don't know if you checked it or just experienced an error and replied
back.

--
Duane Hookom
MS Access MVP
--

Danh said:
Duane,
Sorry but nope. Same thing. It displays "Enter Parameter Value - Item"
(which it has done since the beginning but I can live with that) then
"Enter
Parameter Value - rItem" with the result being "&Name?". Anything else?
Thanks.


Duane Hookom said:
Try:
=rItem.Report!rItemTotals
This assumes the subreport control (the object on your main report) is
named
"rItem". If you are concerned about no records in the subreport, use:
=IIf(rItem.Report.HasData, rItem.Report!rItemTotals,0)

--
Duane Hookom
MS Access MVP
--

Danh said:
Subreport - rItem
Text Box name - rItemTotals
Control Source - =Sum([PUR_PRI])

Main report - rTotalPrinter2
Text Box name - Text87 (in report footer)
Control Source - =Report!rTotaPrinters2!rItem!rItemTotals (many of
hundreds
of combinations of tries)
I either get "Enter parameter value rTotalPrinters2" or no prompt and
"&Name?" or "#Error"
I've put in about 20 some odd hours just trying to get the result of
the
subreport field to display on the main report. It's probably simple
but...
Thanks.
 
Back
Top