Hey everyone,
I playing around with search forms and would like to know if you it is possible to use the declared rs (recordset) as the base for the report.
the Docmd.OpenReport doesn't seem to support this or i'm doing it wrong.
Probably the latter.
The rptPatientInfo is one query with no expressions in it.
How do I set the rptPatientinfo query to rs?
Larry
I playing around with search forms and would like to know if you it is possible to use the declared rs (recordset) as the base for the report.
the Docmd.OpenReport doesn't seem to support this or i'm doing it wrong.
Probably the latter.
The rptPatientInfo is one query with no expressions in it.
How do I set the rptPatientinfo query to rs?
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strWhere As String
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * From dbo_PatientInfo WHERE '" & strWhere & "'")
If Not IsNull(Me.cmbHosp) Then
strWhere = "[ReferOrg] = '" & Me.cmbHosp.Column(0) & "'" & " AND "
End If
If Not IsNull(Me.cmbOrganOutcome) Then
strWhere = "[OrganOutcome] = '" & Me.cmbOrganOutcome.Column(0) & "'" & " AND "
End If
strWhere = Left(strWhere, Len(strWhere) - 5)
DoCmd.OpenReport "rptPatientInfo", acViewPreview, , strWhere
Larry