If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sub-Report Totalling
I was given great advise to achieve the results I needed
by dragging a sub-report into a report ... didn't know I could do that ... worked great! Now I'm trying to grand total a sub-report field into a report footer field in the main report. I used the sum function but it doesn't seem to recognize the field in the sub-report. Is that because the main report is not bound to the same query as the sub- report? How can I overcome this? Please let me know. Thanks! -Howard |
#2
|
|||
|
|||
Sub-Report Totalling
Howard wrote:
I was given great advise to achieve the results I needed by dragging a sub-report into a report ... didn't know I could do that ... worked great! Now I'm trying to grand total a sub-report field into a report footer field in the main report. I used the sum function but it doesn't seem to recognize the field in the sub-report. Is that because the main report is not bound to the same query as the sub- report? You're right. Sum only operates on fields in the record source table/query. A main report can retrieve values from its subreports' controls in the subreport's header/footer sections. The syntax to do this in a main report text box named txtRunTotal is: =subreportcontrol.Report.textbox or if there's a chance that there may not be any records in an instance of the subreport: =IIf(subreportcontrol.Report.HasData, subreportcontrol.Report.textbox, 0) To total those values, set the txtRunTotal text box's RunningSum property to Over All. Then the main report's footer's text box can display the total using the expression: =txtRunTotal -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Sub-Report Totalling
Thanks ... I'll give it a try!
-----Original Message----- Howard wrote: I was given great advise to achieve the results I needed by dragging a sub-report into a report ... didn't know I could do that ... worked great! Now I'm trying to grand total a sub-report field into a report footer field in the main report. I used the sum function but it doesn't seem to recognize the field in the sub-report. Is that because the main report is not bound to the same query as the sub- report? You're right. Sum only operates on fields in the record source table/query. A main report can retrieve values from its subreports' controls in the subreport's header/footer sections. The syntax to do this in a main report text box named txtRunTotal is: =subreportcontrol.Report.textbox or if there's a chance that there may not be any records in an instance of the subreport: =IIf(subreportcontrol.Report.HasData, subreportcontrol.Report.textbox, 0) To total those values, set the txtRunTotal text box's RunningSum property to Over All. Then the main report's footer's text box can display the total using the expression: =txtRunTotal -- Marsh MVP [MS Access] . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Restrict Report To Current Record | Katherine R | Setting Up & Running Reports | 1 | July 15th, 2004 07:23 PM |
Restrict Report to Current Record | Katherine R | Setting Up & Running Reports | 1 | July 15th, 2004 07:23 PM |
Specify Filter criteria before running report | Nikos Yannacopoulos | Setting Up & Running Reports | 3 | June 25th, 2004 09:36 PM |
Problems totalling subreport data on main report (A-2002) | Marshall Barton | Setting Up & Running Reports | 0 | June 23rd, 2004 08:01 PM |
Label | SRIT | General Discussion | 2 | June 22nd, 2004 09:42 PM |