L
lbbeurmann
I am having a problem getting my report to return categorized totals from a
subreport. Specifically, my report only returns the first record in the
subreport and none of the subsequent records. I will try to explain using a
simplified example...
My subreport is adding fruit totals from a query for different types of
fruit and consists of 2 text boxes "FRUIT TYPE" and "TOTAL" where "TOTAL" is
defined by the Control Source =Sum([PIECES OF FRUIT]) from my first query.
This report works fine by itself and I get what I expect, the results look
like this:
Apples 10
Grapes 13
Oranges 7
I am using this report as a subreport in another report based on a separte
but similar query that also totals fruit, but from a different source. What I
am attempting to do is add the category totals from the subreport to the
category totals for the Main report, but I find that only the first record of
the subreport is added and the rest of the categories are not added together.
After this first total, only the main report values are shown and no
subreport values are added.
This is the Control Source that I am using in my attempt to add the two in
the main report:
=Sum([Pieces of Fruit])+(IIf([Fruit report Sub].Report.HasData And [Fruit
Report Sub].[Report]![FRUIT TYPE]=[FRUIT TYPE],IIf(IsError([Fruit Report
Sub].Report![TOTAL]),0,[Fruit Report Sub].Report![TOTAL]),0))
It works correctly for the first record returned by the subreport. So, for
the sake of simplicity, if both queries returned the same numbers as shown
above and the subreport was sorted by "FRUIT TYPE" Ascending, I get:
Apples 20
Grapes 13
Oranges 7
And if it was sorted by "FRUIT TYPE" Descending, I get:
Oranges 14
Grapes 13
Apples 10
I have the subreport in the Report Footer of the Main report, and the Main
report "TOTAL" and "FRUIT TYPE" text boxes are under a "FRUIT TYPE" header.
In the subreport, the "TOTAL" and "FRUIT TYPE" text boxes are under a "FRUIT
TYPE" header.
I have been pulling my hair out for 2 days trying to get this to work. The
frustrating thing is that it partially works, but only for 1 record! I would
appreciate any help as to what I am doing wrong. Thanks in advance.
Regards, L.B.
subreport. Specifically, my report only returns the first record in the
subreport and none of the subsequent records. I will try to explain using a
simplified example...
My subreport is adding fruit totals from a query for different types of
fruit and consists of 2 text boxes "FRUIT TYPE" and "TOTAL" where "TOTAL" is
defined by the Control Source =Sum([PIECES OF FRUIT]) from my first query.
This report works fine by itself and I get what I expect, the results look
like this:
Apples 10
Grapes 13
Oranges 7
I am using this report as a subreport in another report based on a separte
but similar query that also totals fruit, but from a different source. What I
am attempting to do is add the category totals from the subreport to the
category totals for the Main report, but I find that only the first record of
the subreport is added and the rest of the categories are not added together.
After this first total, only the main report values are shown and no
subreport values are added.
This is the Control Source that I am using in my attempt to add the two in
the main report:
=Sum([Pieces of Fruit])+(IIf([Fruit report Sub].Report.HasData And [Fruit
Report Sub].[Report]![FRUIT TYPE]=[FRUIT TYPE],IIf(IsError([Fruit Report
Sub].Report![TOTAL]),0,[Fruit Report Sub].Report![TOTAL]),0))
It works correctly for the first record returned by the subreport. So, for
the sake of simplicity, if both queries returned the same numbers as shown
above and the subreport was sorted by "FRUIT TYPE" Ascending, I get:
Apples 20
Grapes 13
Oranges 7
And if it was sorted by "FRUIT TYPE" Descending, I get:
Oranges 14
Grapes 13
Apples 10
I have the subreport in the Report Footer of the Main report, and the Main
report "TOTAL" and "FRUIT TYPE" text boxes are under a "FRUIT TYPE" header.
In the subreport, the "TOTAL" and "FRUIT TYPE" text boxes are under a "FRUIT
TYPE" header.
I have been pulling my hair out for 2 days trying to get this to work. The
frustrating thing is that it partially works, but only for 1 record! I would
appreciate any help as to what I am doing wrong. Thanks in advance.
Regards, L.B.