Hi! I have a form which has two DTPicker and a listview. The listview display a record based on the startdate and enddate of the DTPicker. After the records are displayed, A button will be click to open another form (frmViewSalesRpt) which has a crviewer in it.
My Question is how do i pass the records of the listview to the crviewer?
or is there other way to do it?
Here's my code:
Right now my code (from RobDog888) will display the whole database records not the records specified/displayed in the listview.VB Code:
Private Sub Form_Load() Call openConnection Me.Left = 2640 Me.Top = 325 sSQL = "SELECT * FROM TblSales" Set oRsSales = New ADODB.Recordset Set oRsSales = oConn.Execute(sSQL) Set oApp = New CRAXDRT.Application Set oReport = oApp.OpenReport(App.Path & "\Reports\Sales.rpt", 1) oReport.Database.SetDataSource oRsSales, 4, 1 CRViewer91.ReportSource = oReport CRViewer91.ViewReport End Sub




Reply With Quote