"ManningFan" <ma********@gmail.comwrote in message
<11**********************@74g2000cwt.googlegroups. com>:
Let's see if I can ask this without confusing you or myself.
I need to be able to type a tablename into a box, and search my
entire database to see which queries are using that table.
Is this even possible?
I would think you could loop the querydefs collection, then investigate
the SQL property of each of them using for instance the InStr function.
air code
sub testing(byval v_strTable as string)
dim qd as dao.querydef
dim db as dao.database
set db = dbengine(0)(0)
for each qd in db.querydefs
if instr(1, qd.sql, v_strTable, vbtextcompare) 0 then
debug.print "found in " & qd.name
end if
next qd
set qd = nothing
set db = nothing
end sub
A search in this NG would probably find a plethora of more advanced
routines to do something like that, including checking for the
tablename
in dynamic sql/code, rowsources, recordsources ...
--
Roy-Vidar