Note:queries created programmatically are invisible in Access. You can view the stored procedures by using Tools->Analyze->Documenter the select Queries Tab, select your query and click OK.
Dim Tb As TableDef
Dim ncStr As String
Dim DB As Database
Set DB = CurrentDb
For Each Tb In DB.TableDefs
If Len(Tb.Connect) > 0 Then '判断是否链接表
Debug.Print "链结表:" & Tb.name
Else
Debug.Print "本地表:" & Tb.name
End If
Next
Dim qry As QueryDef
For Each qry In DB.QueryDefs
If qry.Connect <> "" Then
Debug.Print "传递查询:" & qry.name
Else
Debug.Print "本地查询:" & qry.name
End If
Next