Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2014-02-25
Medium Priority
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
  • 3
  • 2
LVL 85
ID: 39886492
The best tool for doing this is Total Access Analyzer (www.fmsinc.com). It will tell you everything available for a database.

Rick Fisher's Find and Replace (www.rickworld.com) 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 85

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1500 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 85
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have had my own IT business for a very long time. I started mostly with hardware and after about a year started to notice a common theme. I had shelves with software boxes -- Peachtree, Quicken, Sage, Ouickbooks -- and yet most of my clients were…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

577 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