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
|
|||
|
|||
Sum of Amounts in a report
I have a report/sub report. I would like to add the sum
of the report and the sub report and display it on the report. Is this possible? If yes, how? Thanks |
#2
|
|||
|
|||
wrote:
I have a report/sub report. I would like to add the sum of the report and the sub report and display it on the report. Is this possible? If yes, how? Does the subreport appear more than once (e.g. in each detail)? If not, then you can use a text box with a simple expression like: =Sum(field) + subreport.Report.textbox field is the name of the field in the main report's record source table/query that you want to sum. subreport is the name of the subreport control on the main report. textbox is the name of the text box in the subreport's footer that you want to add to the main report's total. -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
The sub report appears in each detail.
-----Original Message----- wrote: I have a report/sub report. I would like to add the sum of the report and the sub report and display it on the report. Is this possible? If yes, how? Does the subreport appear more than once (e.g. in each detail)? If not, then you can use a text box with a simple expression like: =Sum(field) + subreport.Report.textbox field is the name of the field in the main report's record source table/query that you want to sum. subreport is the name of the subreport control on the main report. textbox is the name of the text box in the subreport's footer that you want to add to the main report's total. -- Marsh MVP [MS Access] . |
#4
|
|||
|
|||
In that case, add a text box named txtRunSubTot to the
detail section. Set its control source expression to: =subreport.Report.textbox and set its RunningSum property to Over All. Note that is there's any chance that the subreport might not have any data, the expression should be: =IIf(subreport.Report.HasData, subreport.Report.textbox, 0) The grand total text box in the main report's footer would then be: =Sum(field) + txtRunSubTot -- Marsh MVP [MS Access] wrote: The sub report appears in each detail. -----Original Message----- wrote: I have a report/sub report. I would like to add the sum of the report and the sub report and display it on the report. Is this possible? If yes, how? Does the subreport appear more than once (e.g. in each detail)? If not, then you can use a text box with a simple expression like: =Sum(field) + subreport.Report.textbox field is the name of the field in the main report's record source table/query that you want to sum. subreport is the name of the subreport control on the main report. textbox is the name of the text box in the subreport's footer that you want to add to the main report's total. |
#5
|
|||
|
|||
Is the testbox a textbox in the sub-report footer?
-----Original Message----- In that case, add a text box named txtRunSubTot to the detail section. Set its control source expression to: =subreport.Report.textbox and set its RunningSum property to Over All. Note that is there's any chance that the subreport might not have any data, the expression should be: =IIf(subreport.Report.HasData, subreport.Report.textbox, 0) The grand total text box in the main report's footer would then be: =Sum(field) + txtRunSubTot -- Marsh MVP [MS Access] wrote: The sub report appears in each detail. -----Original Message----- wrote: I have a report/sub report. I would like to add the sum of the report and the sub report and display it on the report. Is this possible? If yes, how? Does the subreport appear more than once (e.g. in each detail)? If not, then you can use a text box with a simple expression like: =Sum(field) + subreport.Report.textbox field is the name of the field in the main report's record source table/query that you want to sum. subreport is the name of the subreport control on the main report. textbox is the name of the text box in the subreport's footer that you want to add to the main report's total. . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Page Margins | Vel | Setting Up & Running Reports | 6 | September 19th, 2004 09:46 PM |
programmatically add controls to report | G | Setting Up & Running Reports | 2 | August 4th, 2004 09:11 PM |
Restrict Report To Current Record | Katherine R | Setting Up & Running Reports | 1 | July 15th, 2004 07:23 PM |
6 Tables, 1 Report, W/O 6 Qrys | Andy | Setting Up & Running Reports | 9 | June 29th, 2004 09:52 PM |
Label | SRIT | General Discussion | 2 | June 22nd, 2004 09:42 PM |