My main report prints one record per page. In the detail section there are 2 continuous subreports. Subreport 1 shows how many items for sizes 1, 2 and 3 were available. Subreport 2 shows how many items for sizes 1, 2 and 3 were ordered. In subreport 2 the 3 sizes % ordered should be 100%. It is for Size 1 (4/4 * 100) but it is calculated incorrectly for size 2 (650 i.e. 26/4 * 100) and for size 3 (175 i.e. 7/4 * 100). It is using the total for size 1 to calculate all percentages. I want to use the correct total on sub report 1 to calculate the % by size.
The Total fields on both subreports are called txtTotal. The % ordered field on subreport 2 is a text box with the following control source:
=IIf(Reports!rptMonthlyOrders!rptsubTotals.Report!txtTotal>0,
(Round((Reports!rptMonthlyOrders!rptsubOrdered.Report!txtTotal/Reports!rptMonthlyOrders!rptsubTotals.Report!txtTotal)*100)),Null)
1. The main report is rptMonthlyOrders
2. Subreport 1 is rptsubTotals and prints as:
Size Total
1 4
2 26
3 7
3. Subreport 2 is rptsubOrdered and prints as:
Size Total %ordered
1 4 100%
2 26 650%
3 7 175%
The subreports are linked to the main report by an ID field. Can anyone please help me calculate the % correctly for each size (i.e. each record on subreport 2).
All suggestions appreciated.
Thank you!
The Total fields on both subreports are called txtTotal. The % ordered field on subreport 2 is a text box with the following control source:
=IIf(Reports!rptMonthlyOrders!rptsubTotals.Report!txtTotal>0,
(Round((Reports!rptMonthlyOrders!rptsubOrdered.Report!txtTotal/Reports!rptMonthlyOrders!rptsubTotals.Report!txtTotal)*100)),Null)
1. The main report is rptMonthlyOrders
2. Subreport 1 is rptsubTotals and prints as:
Size Total
1 4
2 26
3 7
3. Subreport 2 is rptsubOrdered and prints as:
Size Total %ordered
1 4 100%
2 26 650%
3 7 175%
The subreports are linked to the main report by an ID field. Can anyone please help me calculate the % correctly for each size (i.e. each record on subreport 2).
All suggestions appreciated.
Thank you!