I did post a function some time ago: SearchInQueryDefs which shows you where a query or table was used. Should be here somewhere. And you can use control-F to search through the code. To search through code using a function is slightly more complicated.
I have made a start and will post it if you like. Only if you post the result.
The way I do it is, in the database window, locate the specific query you want, right click on it, and select OBJECT DEPENDENCIES.
That will locate every object in the database that uses that query.