Creating Recordset based on a query (rather than a table)


I am not very familiar with recordsets but not too bad either!

Set rs = db.OpenRecordset("select distinct RepArea from qryExportPrepare01")

This line of code gives  Error 3061 Too Few parameters.
It works when I base the select on a table but fails when based on a query.
I need to base my recordset on the query above (NOT a table)

How do I do this?


Patrick O'DeaAsked:
Who is Participating?
Rey Obrero (Capricorn1)Commented:
check if RepArea is one of the fields in qryExportPrepare01 (check spelling)

also check if "qryExportPrepare01" is spelled correctly
Patrick O'DeaAuthor Commented:
Thanks capricorn1

I was looking for a more complicated answer !

(I ignored the obvious!)
Tony BarkdullCommented:
Without seeing the query or the bale it is difficult to pinpoin the error, but "Too few parameters" usually means the "RepArea' is not correct in the query.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.