in the subreport you are defining the value of the shared variable like so...
formula name = sr_totaalorder
Shared NumberVar totaal_order;
totaal_order:= (sum(table.number))
the blue is just an sample option for a value to set it to
Now in the main report you are just making the shared variable again setting it to this new value as this ....
formula name = mr_totaal_order
Shared NumberVar totaal_order;
totaal_order:=totaal_order
now you can use this returned value by referencing the formula field of "mr_totaal_order"
Note that the subreport must be called in a section that is read before the section that you place the main report formula into for it to work
e.g.
RHa = subreport
RHb = placement of mr_totaal_order
Edited by DBlank - 17 Feb 2011 at 5:33am