Results 1 to 6 of 6
  1. #1
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142

    Determining which Queries use which Queries or Tables as Input


    My database has gotten to the point where there are about 30 tables, 100 Queries, 10 macros, 20 appends, and a few reports.

    It's so large now that sometimes I can't remember which queries use which tables and other queries as input. I have to go back into the queries themselves and refresh my memory. That brings up a small dilemma for me now. I'd like to change the name of a couple of tables and queries because the original names are less meaningful now than when they were originally created. In fact, the current name is misleading. I know that can get very tricky and cause problems. So I want to be extra careful about it and make sure I don't miss anything or destroy any linkages.

    Let's say I have a table called "Late Ratings" and I want to change the name to "Track Profile", is there any way I can quickly determine every query that uses that table so I don't miss anything?

    Similar with queries.

    I have a couple of queries that perform general functions that are used by many other queries. Is there any way I can quickly determine every query that uses that query so I don't miss anything?

    Thanks

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you can use the object dependencies feature in Access (under the database tools tab) - although this will not capture references to the table in your code (don't know about macros, don't use them). For code if you open the vba editor, you can search for the table name to see if it is used anywhere

  3. #3
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Did you consider using the database documenter for the queries only? You'd get a printout of the sql statement along with a bunch of query properties.
    Someone else posted here a while ago, trying to put query dependencies into a table, which would require a lot of code. It still had certain limitations as well.
    PS: you really have spaces in your proposed table names?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142
    Quote Originally Posted by Micron View Post
    PS: you really have spaces in your proposed table names?
    When I started, I knew almost nothing. I was self educating on the fly. So many of my initial table and query names have spaces. The new ones do not.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You can run this query as a start (found via Google)
    Code:
    SELECT o.Id
    , o.Name
    , o1.Name AS [References]
    , o1.Type AS TypeOf
    FROM MSysObjects AS o1 RIGHT JOIN
     (MSysQueries AS q INNER JOIN MSysObjects AS o ON q.ObjectId = o.Id) ON o1.Name = q.Name1
    WHERE (((o.Type)=5) AND ((o.Flags)<>3) AND ((o1.Type) Is Not Null));
    For reference of typeof in result

    'typeOf = 1 ...Table
    'typeOf = 5 ...Query
    'typeOf = -32768 ...Form
    'typeOf = -32764 ...Report
    'typeOf = -32761 ...module
    'typeOf = -32766 ...macro

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Search for a free utility called V Tools, which had a deep search function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 10-14-2015, 01:00 PM
  2. Data Input to Queries
    By Luvflt in forum Queries
    Replies: 4
    Last Post: 08-20-2015, 01:13 PM
  3. Help creating queries from combobox input
    By argsemapp in forum Forms
    Replies: 6
    Last Post: 11-25-2013, 05:09 PM
  4. Queries for determining unused amounts of assets/cash
    By Long Tom Coffin in forum Queries
    Replies: 8
    Last Post: 07-05-2012, 01:38 PM
  5. Creating input forms for queries?
    By Brujeria5 in forum Queries
    Replies: 1
    Last Post: 08-14-2009, 08:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums