Mitsules, Mark
Mark.Mitsules at ngc.com
Fri Jul 25 09:05:39 CDT 2003
Bruce, This is elegant...well done. Where is the best place to look for a list & definition of the constants that you used? Mark -----Original Message----- From: Bruce Bruen [mailto:bbruen at bigpond.com] Sent: Friday, July 25, 2003 9:36 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] (Tip) Locate a Table Name within Queries or better still, if there is a tendency to use subqueries: PARAMETERS [Enter table name] Text ( 255 ); SELECT MSysObjects.Name, IIf(IsNull([Expression]),[Name1],[Name2] & "(" & [Expression] & ")") AS SourceTable FROM MSysObjects INNER JOIN MSysQueries ON MSysObjects.Id = MSysQueries.ObjectId WHERE (((IIf(IsNull([Expression]),[Name1],[Name2] & "(" & [Expression] & ")")) Like "*" & [Enter table name] & "*") AND ((MSysObjects.Type)=5) AND ((MSysQueries.Attribute)=5)); B