I have a report that has two sub reports.
I run some code using CRAXDRT to initilize the report in my vb app.
When I try to set the data for either subreport it works fine - as long as there is only one.
When I try to do it for both , the second one comes up with a parameter type input box for the user and then the report gets a field unknown error and does not come up on screen.
How do I initilize two or more subreports and avoid getting an error?
The code I am using is as follows:

Option Explicit
Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report
Dim SubReport As CRAXDRT.SubreportObject
Dim SubReport2 As CRAXDRT.SubreportObject
Dim Sect As CRAXDRT.Section
Dim rptObject As Object

Private RS As Recordset
Private SubRs As Recordset
Private SubRs2 As Recordset

Public Function Init(SelectStr As String, ReportName As String, ShowGroupTree As Boolean, Optional RptComments As String, Optional CompanyID As Long, Optional DataLinkedFieldName As String, Optional DataTypeFieldName As String, Optional DisplayFieldName As String, Optional SubRptStr As String, Optional SubRptObjectName As String, Optional SubRpt2Str As String, Optional SubRptObjectName2 As String) As Boolean
Dim Count As Integer

On Error GoTo Error:
Set RS = New Recordset
If Dir(App.Path & "\" & "Reports\" & ReportName) = "" Then
MsgBox App.Path & "\" & "Reports\" & ReportName & " could not be found", , "Error"
Unload Me

Exit Function
End If
Image1.Visible = False
PicPrint.Visible = False
Screen.MousePointer = vbHourglass
If SelectStr <> "" Then
RS.Open SelectStr, Conn, adOpenForwardOnly, adLockReadOnly
End If
Set CrxRpt = CrxApp.OpenReport(App.Path & "\" & "Reports\" & ReportName)
CrxRpt.ReportComments = RptComments
If SubRptStr <> "" Then
Set SubRs = New Recordset
SubRs.Open SubRptStr, Conn, adOpenForwardOnly, adLockReadOnly
If SubRpt2Str <> "" Then
Set SubRs2 = New Recordset
SubRs2.Open SubRptStr, Conn, adOpenForwardOnly, adLockReadOnly
End If
For Each Sect In CrxRpt.Sections
For Each rptObject In Sect.ReportObjects
If rptObject.Kind = crSubreportObject Then
Set SubReport = rptObject
Set SubReport2 = rptObject
If SubReport.Name = SubRptObjectName Then
SubReport.OpenSubreport.Database.SetDataSource SubRs
End If
If SubReport2.Name = SubRptObjectName2 Then
SubReport2.OpenSubreport.Database.SetDataSource SubRs2
End If
Set SubReport = Nothing
Set SubReport2 = Nothing
End If
End If

If SelectStr <> "" Then
CrxRpt.Database.SetDataSource RS
CRViewer91.ReportSource = CrxRpt
End If

CRViewer91.DisplayGroupTree = True
CRViewer91.Zoom (75)
FieldName = DataLinkedFieldName
FieldTypeName = DataTypeFieldName
DisplayNoFieldName = DisplayFieldName
Company = CompanyID
Image1.Visible = True
PicPrint.Visible = True
ImagePDF.Visible = True
PicPDF.Visible = True
Screen.MousePointer = vbDefault
Init = True

Exit Function
Screen.MousePointer = vbDefault
MsgBox "Error number: " & Err.Number & Chr(13) & Chr(13) & Err.Description & Chr(13) & Chr(13)
End Function