OpenRecordset ... Too few parameters

Q

Question Boy

I have a query which uses a criteria taken from a form

SELECT Contacts.Company, [FirstName] & " " & [LastName] AS Nom,
Contacts.BusinessStreet, Contacts.BusinessCity, Contacts.BusinessState,
Contacts.BusinessPostalCode
FROM Contacts INNER JOIN Contacts_par_categories ON Contacts.no_contact =
Contacts_par_categories.no_contact
WHERE
(((Contacts_par_categories.code_contact)=[Forms]![GuiWordTemplate].[Form].[cboCategorie]));

If I run the Query it works just fine.

Now I need to execute the query from code and loop through the recordset.
When I use the

Set rst = CurrentDb.OpenRecordset("qry_test")

it keeps spitting out an error "Too few parameters. Expected 1"? There is
one parameter, the name of the query to be used (ie: qry_test)!

Why is this not working? How can I get it to work?

Thank you!!!!!!

QB
 

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