One Query - change parameter

J

Jeremy

Hi,

I'm trying to run an Action query repeatedly through
code. Each time I run the query, I want to change some of
the WHERE criteria's values. Can I do this through code?

I can run a query with docmd. But this will not allow me
to change my criteria each time. Is there a way to type
the SQL statement of an action query, within ADO or DAO,
and then control criteria with a variable? I'm fine using
loops and variables, but I'm not sure where to put the SQL.

Can anybody help? I really appreciate it.

thank,
Jeremy
 
T

Ted Allen

Hi Jeremy,

It sounds like the Docmd.RunSQL command will likely be
what you are looking for. You can construct your SQL
string statement by concatenating whatever combination of
text and variables you need and then execute the SQL
statement with this command.

HTH, Ted Allen
 

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