Running a module using Windows Scheduler in MS Access

  • Thread starter Thread starter FA
  • Start date Start date
F

FA

Hi Everybody,
I have a question, i have a module that i want to run automatically
once a week. I think Windows Scheduler will work for that but the thing
is it will open the MS Access database and i am not sure whether it
will run the module for me when it runs the database or MS Access .mdb
file.

If anybody know anything about it please let me know.
 
You can specify a Macro to run when you create the shortcut to for Scheduler
to use. That macro can run VBA code, or whatever you want, then shut down
the application.

<full path to msaccess.exe> <full path to mdb (or mde) file> /x <name of
macro>

The shortcut must include the full path to msaccess.exe (not just to the mdb
file) in order for the flag to be picked up.
 
If you want, simply build a windows script.

open up notepad...and type in

dim accessApp

msgbox "Click ok to run batch job",64

set accessApp = createObject("Access.Application")

accessApp.OpenCurrentDataBase("C:\Documents and Settings\Albert\My
Documents\Access\ScriptExample\MultiSelect.mdb")

accessApp.Run "TimeUpDate"

accessApp.Quit

set accessApp = nothing

msgbox "Job complete", 64



Save the above file...and then re-name the extension as yourfilename.vbs (a
vbs extension).

You can now click on this batch file...and it will run. Note that in the
above a PUBLIC sub called TimeUpDate

It is also important that you shut down as above also. For the actual batch
file you specify in the task scheduler...you will of course remove the two
msgbox commands above...
 
Back
Top