Access Front End won't run as a scheduled task

Bob Vitter 201 Reputation points
2021-01-20T00:49:42.72+00:00

Windows 2012 R2 Server, Windows 10 H2 workstation, MS Access 2016

This problem started recently and is limited to 1 workstation

Scheduled Task runs a batch file which in turn executes DOS commands (Dir, Copy) and Access databases

The DOS commands before the 1st run Access command execute

It used to work on this workstation but stopped recently, it does work on other workstations and works if I directly execute the batch file (double click it)

The Access application opens then immediately stops working - no corresponding Events

I have scaled a test version back to a single VBA command (called from AutoRun Macro) DoCmd.OutputTo (simple table to a text file) and it still fails without creating the text file

Access is left open, I use Task Manager to close Access then I can delete the laccdb file

SFC and DISM do not find any problems, I repaired MS Office but this did not help

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,063 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Jenny Yan-MSFT 9,336 Reputation points
    2021-01-20T02:29:09.017+00:00

    Hi,
    1.For the working and non-working machines, is there any differences like patches installed or any changes made recently?

    2.The Access application opens then immediately stops working - no corresponding Events
    Do you mean there is nothing recorded for this action under Microsoft-Windows-TaskScheduler/Operational?
    How about the Last Run Result?
    58454-image.png

    3.Have you tried to test by different account for this scheduled task as well as other conditions?


    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny


  2. C Data 6 Reputation points
    2021-01-22T15:05:55.647+00:00

    if you have not already, replace the Access front end file of the non working PC with another known-good Access front end file.... and see if that makes a difference.


  3. C Data 6 Reputation points
    2021-01-23T16:13:10.577+00:00

    my experience has been that it was not the PC, but rather the Front End file was corrupted in a way that showed no evidence to it's user otherwise....so I also thought it was the PC... so be sure to double check that by trying that PC with a known-good front end file.... glad you found a fix though....

    0 comments No comments

  4. Bob Vitter 201 Reputation points
    2021-01-27T00:20:30.247+00:00

    I created a new, from scratch Front End on another computer then copied to the computer with the problem - and it failed on execution
    The test FE consists of the AutoExec Macro that executes a Function that assigns a variable and then quits (I also tried executing the function from a form that opens when the FE opens)
    Access opens then stops - there are no associated error events, just Security events documenting the task starting and running Access
    I ran SFC and it did not find any errors and I repaired MS Office but this did not fix the problem
    The Original (actual production FE) ran for a few days then stopped working with the same problem
    In all cases the FE (Test or production) runs fine when directly executed but not when run from a batch file/scheduled task
    The folder that the FE is executed from is a Trusted location

    0 comments No comments

  5. C Data 6 Reputation points
    2021-01-27T00:31:53.03+00:00

    well that is interesting and kudos for being thorough and having a good test plan... Scheduled Tasks is not my wheelhouse so I can't get a handle on why that method of launching will not run.... presuming you could schedule open an excel or Word doc....and those files also could trigger VBA code to run.... hmmm going to monitor this and see if others more into Schedule scripts have input....

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.