Connecting Tech Pros Worldwide Forums | Help | Site Map

Setting parameters in OpenRecordset

Greg Pyle
Guest
 
Posts: n/a
#1: Mar 20 '06
I have created a parameter query (qryAuthors) that reads three parameters
from three different fields on a subform (Subform1). Each time the form
record changes, the query updates automatically. Now, I need to read the
results of this query in an event procedure, but I consistently get a
run-time error (3061): Too few parameters. Expected 3.

The code I'm using to open the query's recordset is as follows:

Set dbs=CurrentDb
Set rst_Auth=dbs.OpenRecordset("qryAuthors",dbOpenSnap shot) 'This is where
the error occurs

Because the query updates automatically and correctly whenever a different
record is selected in the subform, I don't understand how to set parameters
when opening the recordset, or even why it's required.

Can someone please help?

Thanks,

Greg.



Closed Thread