How to get a value from subreport to report

D

Danh

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.
 
D

Duane Hookom

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)
 
D

Danh

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.
 
D

Duane Hookom

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.
 
Top