Calculations from Subreport displayed on main (1 Viewer)

Lithara

Registered User.
Local time
Yesterday, 17:09
Joined
Jan 21, 2005
Messages
10
Ok, this probably has a super simple fix, but I just can't wrap my brain around it. I give up! :)
Anyway. I have a report (rpt_InspSummErrs) with a subreport(sbrp_Subtotalsmry) that displays the sum of items counted in each inspection (in control source labeled sbrp_NoItems, where = sum([#itemsInspected]) from a query). Now I want to have a grand total of items inspected in my main report footer. I created a field called Total Items and used
=Sum([sbrp_Subtotalsmry].Report![sbrp_NoItems])
as my formula in control source but when I tried to go to report view I get a prompt to:
Enter Parameter Value
sbrp_Subtotalsmry.Report!sbrp_NoItems

Help! :eek: What am I doing wrong? I've been at it for two hours now and just can't figure it out.

Forever in your debt,
~Lith
 

geraldcor

Registered User.
Local time
Today, 01:09
Joined
Jan 26, 2004
Messages
145
I believe you have to start your reference with [reports][ReportName] etc.
I think you are just missing that first [reports] telling it that you are looking at a field in another report.
I'll double check.
Scratch that. You don't need that for the subreport reference. From what I've done in a report adding up values I have a text box on the main report called Total1 then I use VBA to say
Reports!rptOtherElementsComparison![Total1] = [rptOtherElementsComparisonSub1].[Report]![CounterTotal]
I have text boxes up to Total10 for ten subreports. Then I just sum those on the main report. I hope that makes sense and is applicable to you. It may be a slight syntax problem too, brackets or ! problems.

Hope this works
Greg
 
Last edited:

Lithara

Registered User.
Local time
Yesterday, 17:09
Joined
Jan 21, 2005
Messages
10
Sorry, I'm still lost. :( I don't know VBA at all, so that limits me a bit. I would like to keep it all in the control source if I can help it, though the synax in your VBA line to the right of the = sign seems the same as the syntax I was using. But thanks for the suggestion Greg.
~Lith
 

Lithara

Registered User.
Local time
Yesterday, 17:09
Joined
Jan 21, 2005
Messages
10
Thanks for the suggestions. I still couldn't get it to work, so I ended up splitting it up into two separate reports. I'll have to do the remaining calculations by hand since I can't seem to get the dang thing to work :mad: . Oh well. Maybe inpiration will come in my sleep.
Other that that the Data Base is DONE! :D
~Lith
 

Users who are viewing this thread

Top Bottom