Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Error 3061" with this SQL for a report

Status
Not open for further replies.

Sylvialn

IS-IT--Management
Dec 28, 2000
101
US
Here's what I have: 1 report (Final) which contains 2 subreports. I need to total each different event (of the two subreports) onto the Final report.
Ex: Subreport1: Name, Event1, days; Name, Event3, days
Subreport2: Name, Event5, days; Name, Event1, days

On the Final report I tried writing an SQL sub and it gives me an error on the line: Set rstQry = dbs.OpenRecordset("qryRptFacPtsSubOne"). Here's the code I have in the report on open:
Private Sub Report_Open(Cancel As Integer)
.....Dim strEvent As String
Dim dbs As Database
Dim rstQry As Recordset.....
Set dbs = CurrentdB
Set rstQry = dbs.OpenRecordset("qryRptFacPtsSubOne")
With rstQry
rstQry.MoveFirst
Do While Not rstQry.EOF
strEvent = rstQry!EventCode
' Set lookup variables to count events
Select Case strEvent
Case "2".........
End Select
rstQry.MoveNext
Loop
End With
End Sub

The error states "Runtime error 3061: Too few parameters, Expected 2." I'm unsure of what else I need though. Any suggestions? "Try everything at least once."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top