I have the following code in an Access 2010 Report
Code:
Dim lpctr As Long
Dim rs As New ADODB.Recordset
Dim strsql As String, lngcomplete As Long, lngincomplete As Long
lngcomplete = 0
lngincomplete = 0
strsql = "Select Status, mbrs from qry_COA_Total_Patients where pcpid = """ & _
Me.PCPID & """;"
rs.Open strsql, CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
Do Until rs.EOF
Select Case rs!Status
Case Is = "Complete"
lngcomplete = rs!mbrs
Case Is = "Incomplete"
lngincomplete = rs!mbrs
End Select
Loop
I'm getting a "No Value given for one or more required parameters" on the line of code that opens a record set the SQL is very simple If I plug it into a new query it runs perfectly but it won't run in code????
The Report source is a summation query of a detail query. The detail query lists all patients for 3 specific measures we are tracking. We also need to know how many individual patients are in these 3 measures as a patient could be in 1,2 or all 3. So I have a query to group the individual patients by status and pcp. The qry_COA_Total_Patients query then counts those patients by status. There are no parameters in any of the queries other than the where clause above.
Any help is appreciated.