 |
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Filter records
There are two ways I know it can be done... If you are using this recordset only for passing it to CR, then you my avoid extra overheat (due to creating this ADO recordset), and use RecordSelectionFormula property of report object. Example:
Dim CRXApp As New CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Set rpt = CRXApp.OpenReport(App.Path & "\Reports\" & rptName, 1)
rpt.RecordSelectionFormula = "{Employee.idno}='" & frmMain.txtidno.Text & "'"
CR.ReportSource = rpt
CR.ViewReport |
To do it using recordset, as you have tried
Dim CRXApp As New CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Dim CRXDatabase As CRAXDRT.Database
Set rpt = CRXApp.OpenReport(App.Path & "\Reports\" & rptName, 1)
Set CRXDatabase = rpt.Database
CRXDatabase.SetDataSource rs, 3, 1
CR.ReportSource = rpt
CR.ViewReport |
|
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
29-04-2005 at 03:36 PM |
|
|
|