How do I find which queries contain a specific table?

J

James R

Is there a way for me to find out if a specific table is contained in any of
my queries in the database? For example, I have table "Turnover Types" and I
need to know what queries I have that contain that table.

Thanks in advance for the help,
James
 
L

Lance

Something in the nature of the following should work.


Dim db As Database
Dim qdf As QueryDef

For Each qdf In db.QueryDefs
If InStr(qdf.SQL, "whatever string") Then
docmd.runsql("INSERT INTO MYTABLE ( QUERY_NAME) SELECT '" & qdf.name
& "'")
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

Top