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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run select Queries in Batch

Status
Not open for further replies.

Hattrick16

Technical User
May 6, 2005
17
0
0
US

My database is structured in a way I can run all the queries that begin with "IP - 0" however can I extend the wildcarding so I run all the queries that begins with "IP - 0" and end with say " -X". There are a lot of queries in the DB and the staff marks each applicable query by placing a " -X" at the end of the name" What would the Syntax be if this is possible. My current code is below.

Dim qdf As QueryDef
Dim DB As Database

Set DB = CurrentDb
DoCmd.SetWarnings False
For Each qdf In DB.QueryDefs
If qdf.Name Like "IP - 0*" Then
DoCmd.OpenQuery qdf.Name
End If
Next
DoCmd.SetWarnings True
End Sub
 
If qdf.Name Like "IP - 0*-X" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top