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
 
Top