Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Code to run multiple queries with simlilar names

Status
Not open for further replies.

jacob102000

Technical User
Sep 23, 2009
2
US
Hi, I am building a database that will be used across many clients and used by many teams so this needs to be a code that will search for specific queries that begin with a specific name. Depending on the client there may be more or less queries that we need to run in order to complete our work, however we use a standard naming convention so as to keep the application user friendly on a global level. I am building a template and with that template I want to be able to click one macro to run all queries that have names starting with ERW_Elig2. There may be only 5 or as many as 30 so the code should be a loop of some kind. I don't want to create a macro with line after line of open query action statements as this will be tedious for each group.

Please let me know if I left anything out that you may need
 
You could have a query that queries the MSysObjects table for anything starting with that combination of words, e.g.
Code:
SELECT Name
FROM MSysObjects
WHERE Name Like "ERW_Elig2*";
Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top