The prefer solution is to use the windows scheduler. That way, you don't
have to leave a large application like ms-access running all the time.
Your batch file that the scheduler runs can simply start a application up.
start "path name to your mdb file"
If you use the above, you must use a autoexec macro in ms-access, or a
startup form that runs code. AND YOU CODE MUST then shut down ms-access.
If you need to run *different* routines all the time, then I would suggest
you use windows scripting .
If you are familiar with windows scripting, then you use what is called
automation.
Here is a example:
dim accessApp
WSCRIPT.ECHO "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
WSCRIPT.ECHO "Job complete", 64
The above windows script would launch ms-access, run a subroutine called
TimeUpdate in a public code module, and then quit ms-access. You can type in
the above text into a standard notepad document. You then re-name the
extension from .txt to .vbs. You can now click on this icon to run the code,
or have the windows scheduler run it once a day, week, hour or whatever.
Note in the above, if you use the windows scheduler, either remove the echo
commands, and use the name of the vbs script directly in the scheduler. Or,
use the command script (cscript).
cscript nameofyourscript
(cscript will ignore the prompts via the echo command).
And, last but not least, you can leave ms-access running, and simply use a
timer event on a form, but I don't think that is great solution here...