Recently I was migrating some tables to SQL from an old Access database. The original programmer had put spaces and other punctuation in the field names that SQL didn't allow so I changed them, but that broke Access when I linked the table back. This code will loop through the querydef collection and find all instances of a table name or field name.
Sub custom()
Dim strSQL As String
Dim qry As QueryDef
Dim db As Database
Set db = CurrentDb
For Each qry In db.QueryDefs
strSQL = qry.SQL
If InStr(strSQL, "[Product Master].[Product Number]") > 0 Then
Debug.Print qry.Name
'MsgBox qry.Name
Debug.Print strSQL
Debug.Print "======================="
End If
Next
End Sub