From: rickr on
Here is a scenario from my report:
The report will grab data with a main query into a parent row
Depending on the data, a child row may exist, if it does the report will
display it
The child row will use data from the parent row in order to do a calculation
in the child

All of this works just fine and the report data is correct.

Now, what I am having issues with is doing the page/report sum calculations.
The requirements dictate that I need to create a sum of both the parent
column and also the child column in the totals.

I have been trying to do this all day and cannot seem to get it to work at
all.

In the page totals, I am trying get something like this:
=Sum([StdLabor])+sum( [Product - Pegged].Report![PegStdLabor] )

But, when I try to execute this, it prompts me for the [PegStdLabor] value
because it is being referenced but the sub-report does not exist yet.

I have also tried the HasData Report parameter (similar problem), and
IsObject, IsError, IsMissing, etc...

I am confused to no end. Any help is appreciated.
From: Marshall Barton on
rickr wrote:

>Here is a scenario from my report:
>The report will grab data with a main query into a parent row
>Depending on the data, a child row may exist, if it does the report will
>display it
>The child row will use data from the parent row in order to do a calculation
>in the child
>
>All of this works just fine and the report data is correct.
>
>Now, what I am having issues with is doing the page/report sum calculations.
>The requirements dictate that I need to create a sum of both the parent
>column and also the child column in the totals.
>
>I have been trying to do this all day and cannot seem to get it to work at
>all.
>
>In the page totals, I am trying get something like this:
>=Sum([StdLabor])+sum( [Product - Pegged].Report![PegStdLabor] )
>
>But, when I try to execute this, it prompts me for the [PegStdLabor] value
>because it is being referenced but the sub-report does not exist yet.
>
>I have also tried the HasData Report parameter (similar problem), and
>IsObject, IsError, IsMissing, etc...


If the subreport might not have any records, change the
expression to:

=Sum(StdLabor)+Sum(IIf([Product - Pegged].Report.HasData,
[Product - Pegged].Report![PegStdLabor], 0))

--
Marsh
MVP [MS Access]