Hi everybody
I have a report set up in VB6 which is attached to an access query.
I want to be able to specify certain criteria to search on before the report opens.
This is what I have so far
Now the report works but brings back everything as in the original query and seems to ignore the code to set the data source to the recordset.Code:Dim Report As New ImportDesigner
Private Sub Form_Load()
sSQL = "SELECT * " _
& "From tblImport " _
& "WHERE " _
& "Import_Date=#8/22/2000#;"
'Open the recordset
Set rstTemp = New ADODB.Recordset
rstTemp.CursorType = adOpenKeyset
rstTemp.LockType = adLockBatchOptimistic
rstTemp.Open sSQL, cnnMIS
'This section is meant to set the report data source to the recordset.
Report.Database.SetDataSource rstTemp
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Does anybody have any ideas.
Thanks
