G
Guest
Hiya
I am running this SQL in VBA and it keeps giving me error: "2 parameters expected
But there is only 1 external reference in the SQL and through the VBA I have taken it out of the string anyway - Could it be because of the left join? Do you know what I might need to change
Code
Set rstColRspns = dbs.OpenRecordset("SELECT IIf([ShortRspns] Is Null,'No Response',[ShortRspns]) AS Rspns "
& "FROM qryAllResponses LEFT JOIN qryRspnsVals ON qryAllResponses.ShortRspns = qryRspnsVals.CompRspns "
& "GROUP BY IIf([ShortRspns] Is Null,'No Response',[ShortRspns]), qryRspnsVals.RspnsVal, qryAllResponses.QstnID "
& "HAVING (((qryAllResponses.QstnID) = " & Forms!frmAnalysis!cboColHead & ")) ORDER BY qryRspnsVals.RspnsVal DESC;"
Thanks
Baz
I am running this SQL in VBA and it keeps giving me error: "2 parameters expected
But there is only 1 external reference in the SQL and through the VBA I have taken it out of the string anyway - Could it be because of the left join? Do you know what I might need to change
Code
Set rstColRspns = dbs.OpenRecordset("SELECT IIf([ShortRspns] Is Null,'No Response',[ShortRspns]) AS Rspns "
& "FROM qryAllResponses LEFT JOIN qryRspnsVals ON qryAllResponses.ShortRspns = qryRspnsVals.CompRspns "
& "GROUP BY IIf([ShortRspns] Is Null,'No Response',[ShortRspns]), qryRspnsVals.RspnsVal, qryAllResponses.QstnID "
& "HAVING (((qryAllResponses.QstnID) = " & Forms!frmAnalysis!cboColHead & ")) ORDER BY qryRspnsVals.RspnsVal DESC;"
Thanks
Baz