issue with shared variable

I have a crystal report in which there is a subreport in report footer1a and the following formuale is used to sum the amount.

Shared CurrencyVar myTotal;

if isnull(Sum ({tblS1.Amount})) = True then
myTotal := 0
else
myTotal := Sum ({tblS1.Amount})

And in report footer1b in the main report I have placed a shared variable.

Shared CurrencyVar myTotal;
myTotal

The amounts are

10
5
-5
-5

so the total should be 5.

It shows up correctly in sub report.But in main report it shows up as 10 ie only once the subtraction of the negative amounts is made.
But the shred variable also should show up as 5.

How can i resolve this issue with shared variable.

Thanks,
–h


hourigan (BOB member since 2007-04-06)