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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
check if RepArea is one of the fields in qryExportPrepare01 (check spelling)

also check if "qryExportPrepare01" is spelled correctly

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Patrick O'DeaAuthor Commented:
Thanks capricorn1

I was looking for a more complicated answer !

(I ignored the obvious!)
Tony BarkdullTier 2 SupportCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.