Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching All Queries in an Access 97 db for Existence of a Table

Status
Not open for further replies.

JabbaTheNut

Programmer
Jul 29, 2002
176
US
I have a large number of queries in an Access 97 db. I am deleting a table and would like to modify the dependent queries. I do not remember which queries are using this table. Is there a quick way I can do a search of tables used in queries.

thank you

Game Over, Man!
 
This query should get you started:
Code:
SELECT MSysObjects.Name, MSysQueries.Name1, MSysQueries.Name2
FROM MSysObjects LEFT JOIN MSysQueries ON MSysObjects.Id = MSysQueries.ObjectId
WHERE ((Left$([Name],1)<>"~") AND (Not (MSysQueries.Name1) Is Null) AND (Not (MSysQueries.Name2) Is Null))
ORDER BY MSysObjects.Name;
 
create a form with a
1 command button
1 textbox
1 listbox


Dim mydb As Database
Set mydb = CurrentDb
Dim qdefs As QueryDefs
Set qdefs = mydb.QueryDefs
Dim qdef As QueryDef
Me.list20.RowSource = ""
For Each qdef In qdefs
If InStr(qdef.sql, Me.Text18) > 0 Then
Me.list20.RowSource = Me.list20.RowSource & qdef.Name & ";"
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top