I built a small report viewer in VB6 using the ActiveX CrystalReport1 control. I have a report that pulls its data from an ADO recordset. I added a subreport that I want to have use the same record source but when the report is displayed the subreport contains no data.
What do I need to add to pass the recordset to the subreport? Here's my code:
cn.Open strConnect
rs.Open "SELECT * FROM DataInput WHERE Date='" & Format(DTPicker1, "mm/dd/yy" & _
"' AND CostCenter='" & strCostCenter & "'", cn, adOpenKeyset, adLockReadOnly
With CrystalReport1
.WindowTitle = "Metrics Tick Sheet Report"
.ReportFileName = App.Path & "\Daily Volume and Time Report.rpt"
.SetTablePrivateData 0, 3, rs
.Destination = crptToWindow
.Action = 1
End With
rs.Close: Set rs = Nothing
cn.Close: Set cn = Nothing
Thanks in advance for any help...
What do I need to add to pass the recordset to the subreport? Here's my code:
cn.Open strConnect
rs.Open "SELECT * FROM DataInput WHERE Date='" & Format(DTPicker1, "mm/dd/yy" & _
"' AND CostCenter='" & strCostCenter & "'", cn, adOpenKeyset, adLockReadOnly
With CrystalReport1
.WindowTitle = "Metrics Tick Sheet Report"
.ReportFileName = App.Path & "\Daily Volume and Time Report.rpt"
.SetTablePrivateData 0, 3, rs
.Destination = crptToWindow
.Action = 1
End With
rs.Close: Set rs = Nothing
cn.Close: Set cn = Nothing
Thanks in advance for any help...