how do I create a macro that will run after a specified time?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am looking to create a macro that will run another macro or application
after a specified time.
eg. macro runs a 10:00 am every morning.
eg2. macro runs ever hour or every 15 minutes

In simpler words like a task in like a reminder in Outlook that pops up onto
your screen.

Thank you for you valued help
 
Thomas

To make a process run at regular intervals, such as in your examples
every hour or every 15 minutes, you can use a form which will always be
open within your application... if such a form doesn't currently exuist,
you can make one especially for the purpose, and have it open in Hidden
mode. Set the Timer Interval property of the form to the number of
milliseconds required, for example 900000 for 15 minutes, and then
assign your macro on the On Timer event property. If the macro does
something which might be in conflict with a current user activity, it
may be advisable to pop up a messagebox for the user to confirm the
macro goes ahead.

Running a macro at the same time every day may require a different
approach. You could use the Windows Task Manager, or some third party
scheduling software, to initiate the event. The Command Line of the
scheduler willprobably be something like this...
"C:\PathToAccess\Msaccess.mdb" "C:\PathToDB\YourDB.mdb" /x YourMacro
 
Sorry, but I can't find the format in which I should use the timerInterval
command ...

I opened the form in Edit mode and created an Event Procedure (Expression
builder), I've selected timerinterval from the list ... but how do I specify
the interval and the macro? It only gives "=[TimerInterval]"
 
Rudolph,

The Timer Interval is not a command, it is a property of the form. If
you look, in design view of the form, to the Property sheet, you will
find this property in the list. You just enter in there a number to
represent the number of milliseconds, for example 60000 means 1 minute.
Then, if you have a macro or VBA procedure in the On Timer event
property of the form, the number that you entered in the Timer Interval
will determine the amount of time before the macro or procedure will run.
 
Back
Top