Automated Macros

dgmorr

Registered User.
Local time
Today, 07:13
Joined
Jan 10, 2007
Messages
71
Hey guys,

Is there a way to have FULLY automated macros run? I would like to use Windows Scheduler to open my Macro which then runs a couple queries. Is there a way to do this unattended?
 
One way you could do it, although probably not the ideal way is to have a form open in the background of your database that has the current time on it - you can get this to refresh as often as you like (every second/minute/hour,etc - the more often, the more it impacts performance)
Using the on current event of this form, you could get it to perform certain tasks if time on form reaches the specified time you want macro to run.

Another way, would be to make your macro an auto exec macro (by naming as 'AutoExec'). This macro is then run as soon as database is opened - you could then get windows scheduler to open database at specified time. the macro could then shut the database down if required
 
Another way, would be to make your macro an auto exec macro (by naming as 'AutoExec'). This macro is then run as soon as database is opened - you could then get windows scheduler to open database at specified time. the macro could then shut the database down if required

How do I handle message pop ups with this approach?
 
by using the set warnings action - set to false to not show messages, and true to turn them back on
 
by using the set warnings action - set to false to not show messages, and true to turn them back on

If you use SetWarnings, you should really use VBA instead of macros, because in VBA you can have an error handler which can turn the warnings back on in case of an error. With macros, if you turn them off and an error occurs before you wind up getting to the one to turn them back on, you will find yourself without any warnings whatsoever for anything, including saving forms, etc. when you go to do things (voice of experience on that one).
 
Very true, I only showed the macro way as that is what they asked for. I totally agree that VBA would be much better way.
 

Users who are viewing this thread

Back
Top Bottom