ACC 2000 - Find Text within a Query using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to use VBA code to programmatically loop through all the
Queries in an Access 2000/2002/2003 database to find a particular string
within the Query? I am guessing I would have to loop through the Queries
collection looking within the SQL text of the query for the string?
 
Tony_VBACoder said:
Is there a way to use VBA code to programmatically loop through all the
Queries in an Access 2000/2002/2003 database to find a particular string
within the Query? I am guessing I would have to loop through the Queries
collection looking within the SQL text of the query for the string?


That's what you can do all right.

For Each qdf On db.QueryDefs
pos = InStr(qdf.SQL, "yourstring")
If pos > 0 Then
'do something
End If
Next qdf
 

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

Back
Top