[AccessD] Find Every Occurance Of A Query

Developer Developer at UltraDNT.com
Thu Nov 6 10:20:15 CST 2003


Paul:
Dim a variable as a querydef, then loop throough all the query defs:
Dim q as querydef
Then use a For Each q in currentdb.querydefs.  Inside the For,
  use instr to check for the name of the query you are looking for:
L=instr(1, q.sql, "qryNameToCheck",vbtextcompare)
If L ' then you have a match. The current value of q.name will tell you
who's using it.  You could use Redim Preserve to come back with an array
of names that reference the query searched for.

Hth
Steve



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
paul.hartland at fsmail.net
Sent: Thursday, November 06, 2003 10:40 AM
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/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list