[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

List Macro Contents

Posted on 2009-05-05
14
Medium Priority
?
485 Views
Last Modified: 2013-11-29
Hello EE,

I need a query to list macro contents (query names, conditions, etc.) for a macro or for all macros.  Is this possible using the Access system tables?  If so, which?

Thank you
0
Comment
Question by:Lawrence Barnes
  • 5
  • 3
  • 3
  • +1
14 Comments
 
LVL 75
ID: 24306552
Tools>>Analyze>>Documenter .... select Macros

mx
0
 
LVL 75
ID: 24306566
You can't get this directly from the system tables, other than a list of macros.  The Documenter will give you what you want.

mx
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24309511
Hi MX,

I've seen your posts before and respect your opinion.  But :)  I've got a LOT of macros with many rows in each.  The output from the documenter is hard to work with.  If the system tables does not support it, is there a way to read these lines and output to a text file via VBA or other means?  (insert pleading look here :)

LVBarnes
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 75
ID: 24309591
I suppose it might be possible using VBA and looping through the Macro collection and if ... all of those properties are exposed ... pulling them out.  I don't have time at the moment to look into that.  I admit that the Documeter is not the optimum tool for this purpose.

mx
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24311120
lvbarnes,

You need to be specific when you say:
   "macro contents (query names, conditions, etc.) for a macro or for all macros."

This is what the documenter does.
So again, can you "specifically" state what you mean when you say that the documenter's output is:
  "hard to work with"
What does this mean, "Specifically".

In other words, can you post a clear example of what you "DO" want the output to be?

Thanks

JeffCoachman
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24314159
Hello Jeff,

Specifically :)  I need all of the elements for each row of a macro placed into a table or a text file so that I can place this information into another data source.

While the documenter does display this information in its own format, it is not easy to transfer this information from the Documenter output to another data source.  It would be much easier if the name and parameters of each element were in a table structure or in a delimited text file.

LVBarnes
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24315578
LVBarnes,

Thanks for the clarification.

I do not know of a way to do what you are asking.

I do know that there are other Products that will document Access databases.
MX would propably know better

The one I am familiar with is FMSinc's Total Access Analyzer.
*However*, the documentation utility only comes as one part of a larger set of tools.
And it is priced a little on the high side.

You should invesitgate one of these utilities.

I believe the Macro "Steps" are incoded into the Access files, there are (AFAIK) not accessible through any system tables.

JeffCoachman
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24363765
you can export a macro as a text file using VBA. The format is
(AutoExec macro)
Version =196611
ColumnsShown =2
Begin
    Condition ="Date()>#6/30/2008#"
    Action ="RunMacro"
    Argument ="Macro2"
End

is this an acceptable format?
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24365268
Hello Capricorn,
I apologize for being a noob... Is the above to setup a function or sub?  I tried running from the immediate window but was missing some pieces.  Where should I place this.

Thanks,
LVBarnes
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24365359
that is an AutoExec macro converted to text file, and i was asking if the format is acceptable ?
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24366224
TY for the clarification.  Yes, I can work with this format.  However for macros with multiple lines, changing to the format below would be easier (but not necessary.)
(AutoExec macro)
Version =196611
ColumnsShown =2
Begin
    Condition ="Date()>#6/30/2008#", Action ="RunMacro", Argument ="Macro2"
    Condition ="", Action ="OpenQuery", Argument ="qryQuery1"
    Condition ="", Action ="OpenForm", Argument1 ="frmForm1", Argument2 ="Form", Argument3 ="FilterName"
End
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 24366374
place this codes in a regular module
create a folder in c:\MyMacro


sub exportMacros()
dim expPath as string,d As Document,C As Container,db As Database

expPath="c:\MyMacro\"      

set db=currentdb
    Set C = db.Containers("Scripts")
    For Each d In C.Documents
        Application.SaveAsText acMacro, d.Name, expPath & "Macro_" & d.Name & ".txt"
    Next d

end sub

that will save all your macros as text file in folder  "C:MyMacros"
0
 
LVL 5

Author Closing Comment

by:Lawrence Barnes
ID: 31578097
Thank you!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24370454
Good tip cap
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

873 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