On 5 Apr 2007 08:18:20 -0700, hedgracer wrote:
Is there any way to generate a list of access queries in an access
database which utilize a specific table? Thanks for all help in
advance.
Dave C.
Does this help?
This shows only named queries.
Public Sub QyerySQL()
' Find the queries that use a specific taqble.
Dim qdf As QueryDef
Dim prp As Property
Dim strTableName As String
strTableName = InputBox("What table?")
Dim Db As DAO.Database
Set Db = CurrentDb
For Each qdf In Db.QueryDefs
If Left(qdf.Name, 4) = "~sq_" Then
Else
For Each prp In qdf.Properties
If prp.Name = "SQL" Then
If prp Like "*" & strTableName & "*" Then
Debug.Print qdf.Name & " " & prp.Value
End If
End If
Next prp
End If
Next
Set Db = Nothing
End Sub
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail