Hello:
I am using the following code to load a report and several sub reports. The main report displays correctly, however, the sub reports do not display at all, not even when I try to load just 1. I have tried different combinations with no positive result. Any help would be greatly appreciated. Thanks.
Private Sub LoadReport()
Screen.MousePointer = vbHourglass
Dim rsMain As ADODB.Recordset
Set rsMain = New ADODB.Recordset
Dim rsCourier As ADODB.Recordset
Set rsCourier = New ADODB.Recordset
Dim rsMisc As ADODB.Recordset
Set rsMisc = New ADODB.Recordset
rsMain.Open app.Path & "\rsDetailMain.rs", , , , adCmdFile
Report.Database.SetDataSource rsMain, 3, 1
Report.ReadRecords
rsCourier.Open app.Path & "\rsDetailCourier.rs", , , , adCmdFile
Set crxSubreport = Report.Subreport1.OpenSubreport
crxSubreport.Database.SetDataSource rsCourier, 3, 1
Set crxSubreport = Report.Subreport2.OpenSubreport
crxSubreport.Database.SetDataSource rsCourier, 3, 1
Report.ReadRecords
rsMisc.Open app.Path & "\rsDetailMisc.rs", , , , adCmdFile
Set crxSubreport = Report.Subreport3.OpenSubreport
crxSubreport.Database.SetDataSource rsMisc, 3, 1
Report.ReadRecords
Set crxSubreport = Report.Subreport4.OpenSubreport
crxSubreport.Database.SetDataSource rsMisc, 3, 1
Report.ReadRecords
Set rsMain.ActiveConnection = Nothing
Set rsCourier.ActiveConnection = Nothing
Set rsMisc.ActiveConnection = Nothing
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
I am using the following code to load a report and several sub reports. The main report displays correctly, however, the sub reports do not display at all, not even when I try to load just 1. I have tried different combinations with no positive result. Any help would be greatly appreciated. Thanks.
Private Sub LoadReport()
Screen.MousePointer = vbHourglass
Dim rsMain As ADODB.Recordset
Set rsMain = New ADODB.Recordset
Dim rsCourier As ADODB.Recordset
Set rsCourier = New ADODB.Recordset
Dim rsMisc As ADODB.Recordset
Set rsMisc = New ADODB.Recordset
rsMain.Open app.Path & "\rsDetailMain.rs", , , , adCmdFile
Report.Database.SetDataSource rsMain, 3, 1
Report.ReadRecords
rsCourier.Open app.Path & "\rsDetailCourier.rs", , , , adCmdFile
Set crxSubreport = Report.Subreport1.OpenSubreport
crxSubreport.Database.SetDataSource rsCourier, 3, 1
Set crxSubreport = Report.Subreport2.OpenSubreport
crxSubreport.Database.SetDataSource rsCourier, 3, 1
Report.ReadRecords
rsMisc.Open app.Path & "\rsDetailMisc.rs", , , , adCmdFile
Set crxSubreport = Report.Subreport3.OpenSubreport
crxSubreport.Database.SetDataSource rsMisc, 3, 1
Report.ReadRecords
Set crxSubreport = Report.Subreport4.OpenSubreport
crxSubreport.Database.SetDataSource rsMisc, 3, 1
Report.ReadRecords
Set rsMain.ActiveConnection = Nothing
Set rsCourier.ActiveConnection = Nothing
Set rsMisc.ActiveConnection = Nothing
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub