Scheduling

  • Thread starter Thread starter Gargamil
  • Start date Start date
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
 
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
 
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
 
Back
Top