Hi,
Can you help me?? I'm using Access 2007. I have a query which uses a number of sub queries in order to build up its data. A couple of the sub queries use a control on a form as to get their parameter (i.e. the year).
Everything works fine, except that now as well as displaying the data on the screen, I would also like to write it to a table in order to keep a historic record.
It seems logical to use the same queries which already give me the data I require. However, every way I try to use the queries in VBA I get an error which says "Too few parameters expected 1". I have tried running the query by using dbs.execute, and I have tried opening a recordset with the query as it's source. Same error each time. The form is always open, and the control is available, so surely it should be able to get the parameters it requires?
It seems that I cannot use a query in VBA if it has a parameter. Is this correct? Can anybody suggest a solution?
Thanks
Colin
Can you help me?? I'm using Access 2007. I have a query which uses a number of sub queries in order to build up its data. A couple of the sub queries use a control on a form as to get their parameter (i.e. the year).
Everything works fine, except that now as well as displaying the data on the screen, I would also like to write it to a table in order to keep a historic record.
It seems logical to use the same queries which already give me the data I require. However, every way I try to use the queries in VBA I get an error which says "Too few parameters expected 1". I have tried running the query by using dbs.execute, and I have tried opening a recordset with the query as it's source. Same error each time. The form is always open, and the control is available, so surely it should be able to get the parameters it requires?
It seems that I cannot use a query in VBA if it has a parameter. Is this correct? Can anybody suggest a solution?
Thanks
Colin