Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Question Unanswered: Remote Control Windows Scheduler from Access - Possible ?

    Is it possible to create a schedule in "Windows Scheduler" from within MS Access (using VBA or other tools) ?

    I want to run an Access macro every morning with Windows Scheduler.
    Can I allow the user to set it within Access ?

    Alternatively, can I create a batch file to control it ? How ?

    Thank you in advance.
    Last edited by Lepanto; 08-16-09 at 21:52.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    My understanding of this says you're trying to put the cart before the horse!

    You can use Windows Scheduler to open up a database, have the macro run and do its thing, and then have the macro close the database.

    The macro will need to be named Autoexec. Like the AutoExec.bat of DOS in days past, an Access macro named AutoExec will run when the database opens, without any user intervention.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so as I understand it you want the user to be able to request an Access process should be run or not within windows scheduler.

    personlly I'd always run the scheduler process but create some sort of mechanism in Access which is picked up as part of the scheduled pricess whether the task(s) whould be run.

    ie the scheduled process always runs, it opens your Access app, your macro or function tests the users settings and takes appropriate action.

    personally I would not want to name the macro autoexec, as that means that macro would run whenever the app is run. you can run a specific macro using the /x command line switch.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    That's true, healdem; my reply made that clear, I thought. I should have said that the macro would need to be in a file dedicated to running this one process.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by Missinglinq
    That's true, healdem; my reply made that clear, I thought. I should have said that the macro would need to be in a file dedicated to running this one process.
    if you want to use the autoexec macro then yes you would have to have another access applciation dedicated to running this process, if you don't want to do that for nay or many reasons you don't have to use a macro called "autoexec", you can give it a specific name. Persoanlly I prefer that approach as if and when people start trawling through Access applciatiosn if you use autoexec it will kick off when the app is first opened, if you don't call this amcro autoexec but say "optionalovernightmacro" then its highly unlikely its goinmg to be run inadvertantly.

    just my tuppeny haporth
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I agree with you about running it when the app is first opened for the day, and thought that might also be a hint to the OP. Of course, this macro may be one of those crank it up, go down the street for a latte and peruse the NY Times then come back for the results kind of macro!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    To answer your question more directly, you can but it's messy:

    Hey, Scripting Guy! How Can I Manage Scheduled Tasks Using Scripts?

    Another route would be to call schtasks.exe with appropriate command line switches. You should be able to find adequate documentation for both approaches.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  8. #8
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Thanks

    Teddy, you are the man. Excellent.
    Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •