Hi everyone, here's my issue:

I have a Crystal Report with a sub report in the page footer that has a parameter field. I know that to pass a parameter to a sub report you have to have a parameter on the main report and link the two parameters.

My problem is that there are a number of different sub reports so they are added to the report at runtime based on the user's selection along with the parameter passed to the main report.

How can I perform a link between the dynamically added subreport's parameter and them main report's parameter. I see that there is a .Links method under the properties of the subreport but I don't know how to use it and what format it's looking for. Here's my code of the addition of the subreport:

VB Code:
  1. If Not IsNull(rsReports("Footer")) Then
  2.        'Page footer
  3.        Set crSection = CReport.Sections.Item("PFa")
  4.        crSection.Suppress = False
  5.        Set crSubReport = crSection.ImportSubreport(strRoot & "\" & rsReports("Footer"), 250, 100)
  6.        With crSubReport
  7.         .OpenSubreport
  8.         .LeftLineStyle = crLSSingleLine
  9.         .RightLineStyle = crLSSingleLine
  10.         .TopLineStyle = crLSSingleLine
  11.         .BottomLineStyle = crLSSingleLine
  12.         .KeepTogether = True
  13.        [COLOR=red].Links.Add.MainReportField ("?FootData")[/COLOR]        
  14.        End With
  15.       End If

Any help or tips would be appreciated. Thanks a lot in advance.