UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> [macro]how To Print The Query Name In A Macro Into A Table, Access 2016    
 
   
hunuyolau
post Oct 16 2019, 09:23 PM
Post#1



Posts: 2
Joined: 16-October 19



Hi there,


I am trying to list out the queries name and RunCode name that are used in a Macro. I would like to list them out in a table of the Access. Is there any VBA/built-in function in Access directly serve the propose?


I know that Access has a documenter function and can export the macro detail into an .xls or .txt. I would like to see if there is method that can directly list out in Macro detail without massage it in Excel.


Anyone has idea on how to do that? Thanks


hunuyo
Go to the top of the page
 
theDBguy
post Oct 16 2019, 10:15 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,566
Joined: 19-June 07
From: SunnySandyEggo


Hi. Welcome to UA! welcome2UA.gif

You may have to create/build your own or try out third-party apps.

PS. I could be wrong but I think it's easier to do something like this with a Module than a Macro.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
isladogs
post Oct 17 2019, 12:51 AM
Post#3


UtterAccess VIP
Posts: 1,806
Joined: 4-June 18
From: Somerset, UK


You can get a list of all database object names from the MSysObjects system table (normally hidden).
The object type is identified using the Type field e.g. Type =5 for queries and -32766 for macros.

AFAIK there is no simple way of exporting macros to a text or Excel file.
I did write some complex code that allows this as part of a deep search routine but its really not worth the effort for most purposes.

Perhaps you are confusing macros with module code which is just text and easily exported.

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
hunuyolau
post Oct 17 2019, 03:29 AM
Post#4



Posts: 2
Joined: 16-October 19



Hi isladogs and theDBguy,

Let me try to further explain what i am trying to do. Here is an example. From the attached file, It is an Macro report that exported through Database docementer in Access. What I particularly want to extract is the data in cell G17 to I19.

I would be perfect if I can print it in an Access table directly and hopefully no need to deal with Excel.

Attached File(s)
Attached File  doc_rptObjects.zip ( 1.86K )Number of downloads: 5
 
Go to the top of the page
 
isladogs
post Oct 17 2019, 07:40 AM
Post#5


UtterAccess VIP
Posts: 1,806
Joined: 4-June 18
From: Somerset, UK


As you've found already exporting the contents of a macro via the database documenter includes all sorts of 'stuff' that you don't actually want.
There is no easy way of getting what you want for macros from Access.
If you instead used VBA code, it would be much more straightforward.

BUT if you must use macros, then I can offer a couple of alternatives.

1. Download the free V-Tools add-in which includes a deep search facility
Although excellent, it is fairly limited for macros. Here is an example of its output for macros:

Attached File  V_Tools_DeepSearch.PNG ( 19.49K )Number of downloads: 3


2. Investigate whether commercial add-ins such as MZ Tools include this feature (at a cost)

3. Consider whether my deep search feature could provide what you want. Here are an example form and report of its output for an autokeys macro

Attached File  SQLSearchForm.PNG ( 95.37K )Number of downloads: 4

Attached File  SQLSearchReport.PNG ( 29.53K )Number of downloads: 1

This is the macro in question:
Attached File  Autokeys_macro.PNG ( 42.28K )Number of downloads: 2


If this looks any use, please PM or email me to discuss further
Its an integral part of a commercial app so I would have to charge for the code.
It would also take time to extract the code so it could be used with another app

Personally I would strongly recommend you give up using macros and move over to VBA code instead

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th November 2019 - 07:29 PM