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
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main report
I am trying to sum amounts contained in sub-reports on to the main report
that contains the sub-reports. Is this possible? If so, does anyone know what the syntax is? thanks |
#2
|
|||
|
|||
Skiman,
In an unbound tetxbox on the main form, enter its Control Source like this... =[SubReport1]![1stAmount]+[SubReport2]![2ndAmount]+[SubReport3]![3rdAmount] This assumes the applicable controls on all subreports will always have a value, otherwise you will need some refinements to cater to Nulls or subreports with no data. -- Steve Schapel, Microsoft Access MVP Skiman1234 wrote: I am trying to sum amounts contained in sub-reports on to the main report that contains the sub-reports. Is this possible? If so, does anyone know what the syntax is? thanks |
#3
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main rep
Dear Steve,
Saw your post about this and I am having the trouble you mentioned about sub-reports having no values, therefore I am getting a #error message. Can you tell me how I get around this? -- CotoJoe "Steve Schapel" wrote: Skiman, In an unbound tetxbox on the main form, enter its Control Source like this... =[SubReport1]![1stAmount]+[SubReport2]![2ndAmount]+[SubReport3]![3rdAmount] This assumes the applicable controls on all subreports will always have a value, otherwise you will need some refinements to cater to Nulls or subreports with no data. -- Steve Schapel, Microsoft Access MVP Skiman1234 wrote: I am trying to sum amounts contained in sub-reports on to the main report that contains the sub-reports. Is this possible? If so, does anyone know what the syntax is? thanks |
#4
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main rep
CotoJoe wrote:
Saw your post about this and I am having the trouble you mentioned about sub-reports having no values, therefore I am getting a #error message. Can you tell me how I get around this? Check the subreport's HasData property: =IIf(subreport.Report.HasData, subreport.Report.textbox, 0) -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main rep
Dear Marsh:
Thanks very much for your post. -- I tried this but it didn't work. Forgive me I am new to Access. I have a main report named rptInvoice with 2 subforms, rptFloaterTrans and rptTaxesSumProp. In the HasData section of the sub-form (not the main form property), I typed IIf(subreport.rptFloaterTrans.HasData, subreport.rptFloaterTrans.textbox, 0). After I exited the expression it put [] around the words "subreport" and [rptFloaterTrans.HasData] . Am I typing this in the right place the right way? Should I put the expression on the main report property HasData section? Thanks again. -- CotoJoe "Marshall Barton" wrote: CotoJoe wrote: Saw your post about this and I am having the trouble you mentioned about sub-reports having no values, therefore I am getting a #error message. Can you tell me how I get around this? Check the subreport's HasData property: =IIf(subreport.Report.HasData, subreport.Report.textbox, 0) -- Marsh MVP [MS Access] |
#6
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main rep
CotoJoe wrote:
I tried this but it didn't work. Forgive me I am new to Access. I have a main report named rptInvoice with 2 subforms, rptFloaterTrans and rptTaxesSumProp. In the HasData section of the sub-form (not the main form property), I typed IIf(subreport.rptFloaterTrans.HasData, subreport.rptFloaterTrans.textbox, 0). After I exited the expression it put [] around the words "subreport" and [rptFloaterTrans.HasData] . Am I typing this in the right place the right way? Should I put the expression on the main report property HasData section? There is no such thing as a HasData section so I have no idea what you are referring to. The place to put the expression is in a main report text box's ControlSource property. You seem to have misunderstood what you need to replace with your own names. The text box's expression would be =IIf(rptFloaterTrans.REPORT.HasData, rptFloaterTrans.REPORT.textboxinrptFloaterTrans, 0) + IIf(rptTaxesSumProp.REPORT.HasData, rptTaxesSumProp.REPORT.textboxinrptTaxesSumProp, 0) Note that the subreport names used here are the names of the subreport **controls** on the main report. These names may be different from the name of the report object they are displaying. -- Marsh MVP [MS Access] |
#7
|
|||
|
|||
How do I sum a total from multiple sub reports onto a main rep
Marshall,
Thanks again and I mispoke. I was talking about the "On No Data" event on the sub-report, my apologies for not being clear. I will give your coding a try and see if I can get it right this time. Will post back my results and again thank you very much for your help. -- CotoJoe "Marshall Barton" wrote: CotoJoe wrote: I tried this but it didn't work. Forgive me I am new to Access. I have a main report named rptInvoice with 2 subforms, rptFloaterTrans and rptTaxesSumProp. In the HasData section of the sub-form (not the main form property), I typed IIf(subreport.rptFloaterTrans.HasData, subreport.rptFloaterTrans.textbox, 0). After I exited the expression it put [] around the words "subreport" and [rptFloaterTrans.HasData] . Am I typing this in the right place the right way? Should I put the expression on the main report property HasData section? There is no such thing as a HasData section so I have no idea what you are referring to. The place to put the expression is in a main report text box's ControlSource property. You seem to have misunderstood what you need to replace with your own names. The text box's expression would be =IIf(rptFloaterTrans.REPORT.HasData, rptFloaterTrans.REPORT.textboxinrptFloaterTrans, 0) + IIf(rptTaxesSumProp.REPORT.HasData, rptTaxesSumProp.REPORT.textboxinrptTaxesSumProp, 0) Note that the subreport names used here are the names of the subreport **controls** on the main report. These names may be different from the name of the report object they are displaying. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Print off multiple reports based on combo box selection | jademaddy | Running & Setting Up Queries | 1 | May 30th, 2005 08:08 PM |
help needed | jkendrick75 | Running & Setting Up Queries | 19 | March 17th, 2005 02:37 PM |
Grand Total Problem | PW11111 | Running & Setting Up Queries | 2 | March 11th, 2005 05:44 PM |
Combine Multiple Reports to send in Email Attachment | Steve | General Discussion | 1 | June 5th, 2004 11:06 PM |