| Feedback | 20 things to do with an Access Query | |
Access contains a tool to document parts of a database, including the macros. The program generates a long report with lots of blank spaces and possibly unwanted information.
The program described below will read each of the macros within the current Access database and identify the actions and parameters on each line. The results are then written to a table.
It does not attempt to interpret the meanings of some of the various parameters which are stored as arguments for each macro action. It is only attempting to identify the main arguments, such as the names of forms and queries.
2 | MacroLines: Select query |
Chars | |
Macro: temp test condition | |
[LookupKeyData(10)=1] OpenQuery 'Audit_Log_recent' | |
[...] OpenQuery 'Audit_Last3' | |
MsgBox 'finished' | |
Macro: Update TempBatchRef | |
SetWarnings 'Off' | |
OpenQuery 'Delete Temp BatchRef' {delete Temp Batch Ref} | |
SetWarnings 'On' | |
OpenQuery 'BatchSelectionStatus1' {open list of completed batches (status 1)} | |
OpenQuery 'Temp BatchRef List' {open temp BatchRef list to be manually edited} | |
MsgBox 'Enter a list of Batch reference numbers to be processed' | |
The output from the program is appended to a table |
Any conditions placed upon macro lines are shown within square brackets. In the first macro ('temp test condition') there is a condition that the user defined function LookupKeyData(10) must return a value of 1. The 3 dots [...] indicate that the same condition is applied to the next line.
The output then shows the action (e.g. OpenQuery) and the target object (inside 'apostrophe' marks). If the macro line has a user comment, this is shown within {curly braces}.
If the results are displayed in a query rather than the actual table, a criteria can be added to exclude actions starting with actions such as SetWarnings or Echo. These are not critical to explaining the purpose of the macro.
Sub AllMacros() |
file: Acc_Macro.htm | Page last updated Apr14 | © MeadInKent.co.uk 2014 | ![]() |