how to schedule macros.

K

Khan

I have a micro that needs to be run every hour. Anyone has
any idea how to do that.
Thanks.
 
V

Van T. Dinh

If you meant every hour while the database is open, then use the Timer Event
of a hidden dummy Form (or a Form that is *always* open when the database is
in use) and run your Macro with the RunMacro Method.

If you meant even when the database is not open, then create a Shortcut Icon
using the /x option of the (Access) Startup Command-Line Options (check
Access Help) to run your Macro. You can then use the Windows Scheduler to
run this ShortCut Icon every hour (???).
 
B

bzamfir

Hi,

You can create form, which will be run hidden as below

docmd.OpenForm "", , , , , acHidden

Set the form's TimerInterval propert to 3600000
and add the following code to On Timer event procedure


Private Sub Form_Timer()
DoCmd.RunMacro "yourmacroname"
End Sub

If you need more help, you can contact me.

HTH,
Bogdan Zamfir

______________________________
Independent consultant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top