[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

List Macro Contents

Posted on 2009-05-05
14
Medium Priority
?
483 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
[X]
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
  • 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 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