Create status log from within a macro

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

I have a macro in Access that performs several steps that is run in an
unattended mode (from the command line via a scripting language).
What I'd like to do is have the macro record to a text file where in
the process it is in order to track down where a problem occurs. For
example, the log might look like this:

<date> <time> Before run delete query on table table1
<date> <time> Before text import for table table1
<date> <time> Before run delete query on table table2
<date> <time> Before text import for table table2
etc.

<date> and <time> would be the date/time the line was recorded in the
log (if possible).

Is this possible or is there a better way? The idea is to have one
'controlling' macro run the other 'worker' macros that do the actual
work. I suppose I could individually run the 'worker' macros but
would prefer the first method.

Thanks,
Doug
 
Doug,

You could have a table in your database for logging the progress. Then
you could insert RunSQL actions in your macro between each existing
action, the SQL Statement argument may look something like this...
INSERT INTO StatusLog ( EventTime, Procedure ) VALUES ( Now(), "Before
run delete..." )
 
Back
Top