Scheduling

G

Gargamil

Is there a way to schedule when a query is run within a database? I have a
query that needs to be run at 11am every Monday morning. Any clues?

g
 
P

Perry

If you mean, the query needs to run when the database isn't opened,
you wud need to consider to use a scheduled Visual Basic exe in which
code similar to below pseudo code is included in Sub Main()

Dim ac As New Access.Application
ac.OpenCurrentDatabase ("D:\MyDocs\Access\Mydatabase.MDB")
ac.DoCmd.RunSQL "MyQueryString"
Set ac = Nothing

Have yr System Admins schedule this executable in NT Scheduler

Or look at a Scheduler utility by Dev Ashish
http://www.mvps.org/access/modules/mdl0042.htm

Krgrds,
Perry
 
J

Jeese Avilés

If you mdb is opened you can attached code to an open
form (that should stay open at all times) Timer event.
Set you form timer event to 60 minutes (3600000 ms).
Then do something like the following:

dateNow as date
dateNow = Now()
if datepart("d","dateNow") = "Monday" and datepart
("h","dateNow") = "11" then
docmd.echo off
docmd.openquery "YourQuery"
docmd.close acQuery, "YourQuery"
docmd.echo on

Jesse Aviles
monk @ coqui . net
 

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