Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Subreport Total to Main Report

Status
Not open for further replies.

monika102001

Programmer
Sep 25, 2005
26
US
Please Help Me,

What am I doing wrong?? I need have total value from subreport and put to Main Report in Report Footer. I have:
Subreport Name: CRTS_BusinessC_OwnChSubreport
In Report Footer is text box that has total i needed for Main Report in Report Footer: Name:Total_Sub (has Running Sum:OverAll)

In Main Report I made a text box in Report Footer with Running Sum:OverAll:
Name:Total_Report
Control Source:=CRTS_BusinessC_OwnChSubreport.Report!Total_Sub

 
monika102001
The subreport "Total_Sub" ... is that pulling the total for each record? Or is that actually the text box that is providing the running sum over all?

In any event, you might try enclosing things in square brackets...as
=[CRTS_BusinessC_OwnChSubreport].[Report]![Total_Sub]

By the way, if there's any chance of your subreport not having data, you need to test for data, using the HasData property. Such as...
=IIf([CRTS_BusinessC_OwnChSubreport].[Report].[HasData]=-1,[CRTS_BusinessC_OwnChSubreport].[Report]![Total_Sub],0)

Tom
 
Hi Tom,
Thanks for quit reply, I already did try with the brackets and didn't work.I read your previous replies for someone who postpone the same question I did what you wrote and I don't know what I'm missing.

Total_Sub is textbox from Subreport and already has total value. And I know this one has data

What else I should look to debug?

Thanks
 
monika
I notice that you are making the Total box in the Report Footer "running sum." Why? Try making it just a regular text box, without running sum.

Tom
 
Tom,
I just did without running sum, it's still not working
 
monika
Are there a number of records for which the report is being run? Or is this a single report?

Tom

 
I tell you want more time what I did:

Subreport - CRTS_BusinessC_OwnChSubreport
Text Box in subreport in Report Footer - Total_Sub and has the control soure =[Sub_Ownership]
where Sub_Ownership is the name of the text box in the same subreport detail where control source is: =IIf([C_OwnershipChange]=-3,1,0)and has running sum: Overall

In Main Report - text box named Total_Ownership with control source =CRTS_BusinessC_OwnChSubreport.Report!Total_Sub ( I tried with brackets and without also I tried iif the one you sent me for no data)
 
Tom,
In subreport there are many records, so I need the total where field name C_OwnershipChange = -3
 
monika
In the subreport's footer, you have the [Total_Sub] text box. I get that part.

In the main report, try putting your
[CRTS_BusinessC_OwnChSubreport].[Report]![Total_Sub]
in the Detail section rather than in the main report's footer and see if that gives you what you want.

If not, we have to look further.

Tom
 
I see the correct value in subreport and if I run the main report the value is correct in the place where subreport is, so calculation is correct
 
i'm thinking is somtething with refrences on the text box in the main report, any clue?
 
monika
I was going to ask if the subreport is showing the correct values. Your second last post says it is. So you are good so far.

Is the [Total_Report] text box an "unbound" text box? If you tried to set it up by dragging in a field and then changing the ControlSource it might not work. If it's not fully unbound, try creating another one from scratch.

Tom
 
Tom,
When I'm running the main report with text that has control source:
=[CRTS_BusinessC_OwnChSubreport].[Report]![Total_Sub]
then if I look at the text property Access change the text control source without brackets
 
I tried that even before you mentioned and I tried again now and still nothing
 
Do I have to change any properties for these text boxes or anything like that?
 
monika
Well, you shouldn't have to change any properties, but I am still wondering about the text box in the subreport's footer. Copy the Control Source for it and post it.

Tom

 
What else I can tell you, the main report has 9 subreports, so for each subreport I have to get a total, so I'm trying for first one to get work, so I can do rest of them
 
monika
I agree with your approach. Get one right and then work on from here.

But we seem to be missing something here.

Are you sure the subreport is giving you the correct value in every record?

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top