Hi all
I am trying to run a query that has a parameter from VBA.
I have a query that takes a date from a form as its parameter. When a field is updated, I want the query excecuted and to use the data from the recordset.
The code I am using is:
rsMyRs = dbMyDb.OpenRecordset("qryGetByDate"
where rsMyRs is a recordset, dbmydb is the current database and qryGetByDate is the query.
When I open the query from the Access window, the query runs fine and gets the parameter from the form. However, whne I run it using the code above I get an error message "Too few parameters: Expected 1".
I'd appreciate any help you can give!
Thanks
Matt
I am trying to run a query that has a parameter from VBA.
I have a query that takes a date from a form as its parameter. When a field is updated, I want the query excecuted and to use the data from the recordset.
The code I am using is:
rsMyRs = dbMyDb.OpenRecordset("qryGetByDate"
where rsMyRs is a recordset, dbmydb is the current database and qryGetByDate is the query.
When I open the query from the Access window, the query runs fine and gets the parameter from the form. However, whne I run it using the code above I get an error message "Too few parameters: Expected 1".
I'd appreciate any help you can give!
Thanks
Matt