Recordset / Query Problem

G

Guest

I'm having an issue that's driving me nutz...

everytime I try to run a function that uses a stored query as the source of
the recordset, I get an error of "Run-tim error '3061': Too few parameters.
Expected 1."

This used to work, then I stopped working on the db for a while. When I
came back to it (probably 2 weeks later), it wouldn't work for me. I
stripped out just about all the code from the function and just tried the
basics of it and still the same thing.

Currently, my code looks like this:

Dim rs as DAO.Recordset
Set rs = CurrentDb.OpenRecordset ("SELECT * from qryRound1;")

When I hit debug, it highlights the "set rs" line. Please help.

- JC
 
G

Guest

Dim db as DAO.Database
DIm r as DAO.recordset

Set db = CurrentDB
Set r = db.Openrecordset("SELECT * FROM myQry;")

Of course, you want to open myQry from database window to make sure it
doesn't really need any params.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top