To pass data back from a subreport, use a shared variable. For a string, put a formula field in the subreport like
Code:
Shared StringVar
NameFound := {report.name}
To access it in the main report, create another formula field with
Code:
whileprintingrecords;
Shared StringVar NameFound;
NameFound
Note that the shared variable is only available in the section after the section which contains the subreport.
In your case, you should have two separate shared variables for the two reports. And make them very small, assuming you are not intending to display anything from them.
If you can avoid subreports, this is more efficient. One option is to add the same table more than once: it is called an Alias and is treated as indepenent.
PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)