Too many parameters, expected 1 -- nested queries

H

HartJF

I was intrigued by Marshall Barton's response to astronomr5's posting on
9/20/05 stating the need to resolve query parameters.

I have a wrinkle on this issue...

I have nested stored queries: qry1 has as one of its recordsources qry2;
qry2 has a parameter prm2. I set the parameter:

qdf2.parameters("prm2")=prm_value

....and then run the resolution:

for each prm in qdf2.parameters
prm.value=eval(prm.name)
next

....the code stops with the error "Microsoft Office Access can't find the
name 'prm2' you entered in the expression." I mouse-over "prm.name" and the
tip responds "prm.name='prm2'"; I mouse-over "prm.value" and the tip responds
"prm.value='prm_value'".

I don't understand Marshall's comment "different for prompts" after the
Eval() statement. I'm not sure that I understand what resolving actually
does, other than to assign the parameter's value to itself.

I have set explicit references to DAO for querydef, recordset, and parameter
objects, and I have added parentheses to CurrentDb().

What am I missing?
 

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