Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Variable Won't Work Properly

Status
Not open for further replies.

BBousman

Programmer
May 10, 2004
57
US
I'm trying to take the value of a shared variable from a subreport and add it to a Total Cost formula on the main page. I have the subreport in GH1a and the shared variable in GH1b but whenever I try to add the value to the Total Cost, it just returns all the shared variables to $0.00. Here's what it should look like:

Labor Burden Material Total
$106.26 $191.26 $472.67 $770.19

If I put the shared variable for Material in GH1a, then it will look like this:

Labor Burden Material Total
$106.26 $191.26 $0.00 $297.52

I know that you have to have the variable in a different section than the subreport which is why it's printing that $0.00 but for some reason it won't add it to the Total from within GH1b. The value for Material comes from a subreport and won't add to Total no matter how I set it up. Does anyone have any ideas of how to make this work?
 
Crystal does things in a definite order. For a section with a subreport, the subreport is processed last. Any other function happens first, including showing a total returned using a subreport. Also adding that total - is that what you are doing?

If not, please post your Add formula.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I found a different way of doing it. Instead of having my shared variable in GH1b and everything else in GH1a, I switched them and put everything in GH1b and the subreport in GH1a by itself and made it so small you couldn't see it. So now it will print and add right!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top