One Query - change parameter

  • Thread starter Thread starter Jeremy
  • Start date Start date
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
 
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
 
Back
Top