Queries using a particular table

  • Thread starter Thread starter shaggles
  • Start date Start date
S

shaggles

Is there a way to get a list of queries using a particular
table? I have to make a fairly significant change to one
of my tables and I need to modify all the queries that use
this table. I remember seeing code that did something
like this out on the web but I can't find it now.
 
Paste this function into a new module;

Function FindQueries(strTableName)
Dim qdf As QueryDef
For Each qdf In CurrentDb.QueryDefs
If InStr(qdf.SQL, strTableName) <> 0 Then
Debug.Print qdf.Name
End If
Next qdf
End Function

In the immediate window type the following to see a list;

?FindQueries("YourTableName")
 
Back
Top