Don't forget that a Query can have other Queries as its data sources, not
necessarily Tables, and those could be based on other Queries, too. Parsing
the SQL to get the tables may not be as simple as I made it sound.
Uh, you indicated what you want to get, and how you want to get it, but not
what you are trying to accomplish with the information, nor whether there's
a compelling need to do it at runtime, or whether it could be done in design
view.
It almost reads as if you want to create a "where used, by whom" kind of
Report.
My applications do not allow the user to create Queries inside; they may,
sometimes, have the ability to create a separate MDB, link the common
backend tables, and do their own querying.
Best regards,
Larry Linson
Microsoft Access MVP