[AccessD] Find Every Occurance Of A Query

Andy Lacey andy at minstersystems.co.uk
Thu Nov 6 11:50:24 CST 2003


Paul
Here's some code. Just call it from the immediate window as in:

? SrchQdefs("qryUnionAvailabilityTables")




Function SrchQdefs(strSrch as String)
'Pass all queries and searches for a given string in the SQL
Dim db As Database
Dim qry As QueryDef
Dim Mysql As String
Set db = CurrentDb()
For Each qry In db.QueryDefs
  If InStr(1, qry.SQL, Srch) <> 0 Then
    Debug.Print qry.Name
  End If
Next qry
Set db=Nothing

End Function

HTH

Andy Lacey
http://www.minstersystems.co.uk 


> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> paul.hartland at fsmail.net
> Sent: 06 November 2003 15:40
> To: accessd
> Subject: [AccessD] Find Every Occurance Of A Query
> 
> 
> To all,
> I have a query named qryUnionAvailabilityTables, is there 
> anyway I can find out any other Query that uses 
> aryUnionAvailabilityTables without going and looking at 
> everyone of them, i.e. some code to loop through all the 
> queries I have looking for this etc. I would look manually 
> but we have over 250 queries in our main database. Thanks for 
> any help in advance....... Paul Hartland 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/a> ccessd
> Website: 
> http://www.databaseadvisors.com
> 
> 




More information about the AccessD mailing list