Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 656
  • Last Modified:

Scheduled Task will not work properly to run Access Macro

I have a macro in Access that I need to run once each day.  I created the macro, then created a scheduled task to execute the macro.  When I right click and select "run" on the scheduled task it works perfectly.  

However, once logged off and I let it run on its regular schedule it is not working.  Access is indeed opening, but it is not running propely.  It starts to run and opens Access, but it would appear the macro never runs and Access is remaining open, as if it is getting hung up.  I have to go in some time later and kill the MSAccess process.  However, if I am logged on I can watch the scheduled task execute and work properly.  

I have checked permissions on all folders as well as the database that contains the macro and the adminstrator has full control.  The scheduled task executes as the administrator as well.

Any advice would be appreciated!
Thanks!
0
dcgimo
Asked:
dcgimo
  • 9
  • 7
  • 2
1 Solution
 
jmoss111Commented:
In the scheduled task, is the only run if logged in checkbox checked?
0
 
dcgimoAuthor Commented:
No, it is unchecked.
0
 
jmoss111Commented:
Is your password set?
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
dcgimoAuthor Commented:
Yes, and I am not getting any errors or anything that would make me think it is incorrect.  I have even tried to recreate it several times just in case, and also had someone else type it.
0
 
jmoss111Commented:
Or should I say has your login password changed since you set the task password?
0
 
dcgimoAuthor Commented:
Nope, no changes to it.
0
 
Jim P.Commented:
I believe the problem is that Access will only run when the box is logged in even if the screen is locked. It may not work on a locked screen either.

Access is not a service and depends on the ability to output to the screen in some fomr or fashion. I have never really tried to run Access without the server/workstation logged in, but I don't think it will work.
0
 
dcgimoAuthor Commented:
Hmmm, maybe you are right.  Perhaps I can run it in a sql query instead if needed.
0
 
jmoss111Commented:
Do you log in through a domain?
0
 
jmoss111Commented:
I log in through a domain and have to change the password in the task scheduler for each task every 30 days when my password expires or my scheduled jobs wont run.

Jim
0
 
dcgimoAuthor Commented:
Jim- I log in as the adminstrator on the server and that password does not expire.  I saved the password in the task again just in case and still had the same results.
0
 
Jim P.Commented:
I don't think you can run Access unless the server is logged in. Only services can be run, and Access is looking for "user interaction" even with the macro.
0
 
jmoss111Commented:
I have jobs that run early every morning, some 5 days a week, some 7 days and I'm not logged in.

The Access dbs do load a form at startup and my code is in the ONLoad event.

Jim
SchedScreenShot.doc
0
 
dcgimoAuthor Commented:
Jim- it looks like you are simply directing the scheduled task to open Access, but Access itself runs your tasks as soon as it opens.  Do you have problems with Access closing after the fact?  How are you handling that?  I'm going to give this a try!
0
 
jmoss111Commented:
Nope, it does it's process, send mail notification and closes. I never touch it. I have multiple jobs like this performing different tasks running on multiple systems and I never have to touch them.

I do put a DoCmd.Quit at the end of the process, thats all.

Hope it works out for you. Let me know.

Jim
0
 
jmoss111Commented:
I have a RAOC (random array of obsolete computers) in a cubicle that perform loads, reporting, mailing, ftp, data hygiene, etc.
0
 
dcgimoAuthor Commented:
Jim-  this was a great help.  I think the key point that you mentioned was that you are placing your code on a form.  I had everything in a macro and was running the macro and then it was getting stuck (running queries via the macro).  I broke everything down and put it in the onopen event on a form.  I then directed my scheduled task to run a macro that simply opens that form.  Everything is working great now and Access is closing properly with the docmd.quit command.  Thanks for all your help!
0
 
jmoss111Commented:
You're welcome dcqimo; and thanks for the nice comments!

You might want to shift that to the OnLoad event...

I'm glad that I was able to help.

Jim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now