There is a lot of shared variable information in your online help in Crystal Reports.
Essentially, you will be creating one formula in your subreport, like:
//@Populate The Variable
WhilePrintingRecords;
Shared NumberVar XXX := {YourField};
and another one in your main report - which is placed in a section after your subreport:
//@Call The Variable
WhilePrintingRecords;
Shared NumberVar XXX;
If you want to accumulate the value of the variable in the main report so that you can get a grand total going, then you would use a formula like this one:
//@Add Up Each Occurence Of The Variable
WhilePrintingRecords;
NumberVar YYY;
Shared NumberVar XXX;
YYY := YYY + XXX;
You would have to place a formula like the last one in a B section of wherever the subreport is placed. For example, if the subreport is situated in Group Footer 1a, then you place the formula in Group Footer 1b.
Naith