Hi Everyone.
I'm using a code to leave some things dynamic in a report (rptGraph):
...
the qryGraph SQL contains a HAVING which uses a field from the report
qryGraph runs succesfully if executed while report is running. Also the DCount line in the code above prints the correct number. I get an error "runtime error 3061 too few parameters when OpenRecordset - Expected 1" on the Set Qry_GraphData line of the code, while the other Set line doesn't give me any error.
Anyone knows why do I get the error, and how can I solve this?
Thanks very much
inso18.
I'm using a code to leave some things dynamic in a report (rptGraph):
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim MyDB As Database, Qry_RoundOrder As Recordset, Qry_GraphData As Recordset
Set MyDB = CurrentDb()
Set Qry_RoundOrder = MyDB.OpenRecordset("qryRoundOrderCurrNetSel", dbOpenDynaset)
Debug.Print DCount("abc", "qryGraph") 'prints a positive number
Set Qry_GraphData = MyDB.OpenRecordset("qryGraph", dbOpenDynaset)
the qryGraph SQL contains a HAVING which uses a field from the report
Code:
HAVING (((ttblData.BranchId)=[Reports]![rptGraph]![BranchId])
qryGraph runs succesfully if executed while report is running. Also the DCount line in the code above prints the correct number. I get an error "runtime error 3061 too few parameters when OpenRecordset - Expected 1" on the Set Qry_GraphData line of the code, while the other Set line doesn't give me any error.
Anyone knows why do I get the error, and how can I solve this?
Thanks very much
inso18.