Is there anyway to document all the nested objects used in an MS Access macro

Posted on 2014-02-25
Last Modified: 2014-02-26
Hello all,
I have a huge MS Access migration coming up and I'm trying to prep for it now.  Not only are we bringing up new servers, but we're also going to be converting a boatload of old (2000 - 2003) Access databases to Access 2007 (it might end up being a new version, but the version doesn't matter for this request).  What I'd like to do is clean up the databases by only bringing over the objects that are needed.  Each database has a primary Macro that runs and does a bunch of stuff.  What I'd like to be able to do is programmatically list all the objects, nested objects, functions, etc used by that macro.  

For instance:
Lets say I have a Macro called "mcrAutoRun".  That macro starts by running another macro named mcrM1.  mcrM1 runs a make table query called qryM1_Make to create the tblM1 table.  qryM1_Make uses a select query called qryM1_Select and is made up of two tables (tbl1 and tbl2).  After that the mcrAutoRun macro runs a delete query called qryM2_Delete which deletes the records in the tblM2 table.  Then the mcrAutoRun macro runs an append query called qryM2_Append to append the tbl3 records to the tblM2 table.  Lastly it runs a function called SetCurrentDate(now()) which updates a value in the tblDates table.

What I want to do is pass the macro name to some code and have it printout a list of all the dependent objects.  Whether it prints to the intermediate window or to a table or to a text file, doesn't matter to me.  The desired output would be something like this:

Macro - mcrAutoRun
Macro - mcrM1
Query - qryM1_Make
Table - tblM1
Query - qryM1_Select
Table - tbl1
Table - tbl2
Query - qryM2_Delete
Table - tblM2
Query - qryM2_Append
Table - tbl3
Table - tblM2
Code - SetCurrentDate(now())
Table - tblDates

Any help or direction would be GREATLY appreciated.
Question by:shannonds
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 84
ID: 39886492
The best tool for doing this is Total Access Analyzer ( It will tell you everything available for a database.

Rick Fisher's Find and Replace ( can do the same thing, although it's not as robust as TAA, and you'll have to dig around a bit more.

Author Comment

ID: 39886998
How would you do this in TAA?  I've never used it before and it's a little unclear as to how to tell it to give me a list of all the objects used in a selected macro.  In the documentation wizard, I selected only the macro I'm interested in.  Went through and named the output file and it went ahead and did it's thing, but the end result wasn't what I'm looking for.  It looks like it will do what I'm looking for, I just don't understand how to get it to do it.  I looked for an online demo/tutorial, but no luck.
LVL 84

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39888353
Total Access Analyzer has a complete help file, and will go over all the options needed.

Essentially you would allow TAA to analyze your database, then use the Documentation Explorer to review those objects. There is a "Macro" category in that explorer, which would tell you what you need to know about each macro. Click on that, then expand the Macro you want to review, and you'll see all the details you could ever want to know about TAA.

TAA won't print items exactly as you listed here (nothing will, unless you code it yourself) but it will get you where you need to be.

Author Closing Comment

ID: 39888592
Would have preferred some code I code write to loop through the object collection or something like that, but it looks like Total Access Analyzer might do what I need.  Unfortunately, it takes FOREVER to run.  I have a feeling that this process is going to be painful...  LOL
Thanks for pointing me in a direction.
LVL 84
ID: 39889316
It's always painful ...

FWIW, you could write code to show you the various attributes of different objects, but since you're looking for dependency information, the process is a LOT trickier. You'd need to parse out the SQL of each query and try to find the various object/field names, and then go from there.

I tried it once, and ended up spending a LOT more time than was necessary on the project ... overall, you're far better off just biting the bullet and using TAA.

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access VBA Object Variable Not Set. Can't figure this out. 11 43
Microsoft Access 2016 Bug? 9 43
Replacing an Access Error with a Custom Message 3 29
Access query error 3 24
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question