I'm doing one social project and use only Acess/Office 2013 available, and trying to send email reminders for some event based on calculated column [Due_date] -[Today] < 10 days, my customers most likely won't open Access every day, so I'm wandering if any option exists in Access to schedule this job/check let say every 8am ? Is it basically possible with only Acess ???
*I also deal with actual autoemail VB script, but without solving scheduling task it probably wont' work anyway.
Appreciate your feedback. THanks
Dai
There's no scheduler built-in to Office specifically... but Windows has one.
Windows' Task Scheduler can be used to schedule code to run in Office applicationss using Office's command-line options
You should be able to find the task scheduler in the Start menu b hitting the and typing task, or by pressing +R and then typing taskschd.msc in the Run box.
There are numerous options for "how" you want to schedule your tasks. For example I have an Access DB that auto opens every 8 hours (waking it from sleep if necessary) to perform a task, and other that runs at logon if it hasn't run in the last 12 hours.
more Information:
Office.com : Command-line switches for Microsoft Office products
Office.com : Command-line switches for Access
(/x and /cmd are especially useful for this.)
Windows Dev : Task Scheduler
I have used Task Scheduler, and similar, to open many Access DB front-ends at various frequencies from 15 minutes to a week.
It goes like this: open file, autoexec macro then opens a Form, Form_onOpen executes whatever code I want - including DoCmd actions to delete table records, create new tables, run reports, export to Excel, export as acrobat files, etc. and then save and Quit. Very useful for overnight mining SQL Server-based work management systems.
Related
I have an access database that uses data pulled from an API, this data export is conducted hourly.
I would like the access database to automatically run an update module (which imports the exported data and cleans it up), based on the same schedule the API exports my data, so Access will be current at all times.
The database I designed is used company wide. The accde and backend are both located on a windows 2008 server.
I just wanted suggestions on the best way to automate this, without the need of human intervention, preferably nor my local machine.
From rough research (accompanied by my own ignorance and stupidity) I’m assuming I need to setup a task scheduler on the server to launch access and run the module on open if FOS username is the local machines user (administrator).
I highly welcome any feedback as again, I just taught myself access these past two months and am horribly unknowledgeable on the implementation side.
I want to run an MS Access function only once a day at a certain time - 6 a.m. The computer (Windows 2010) runs the whole day. What is the easiest and nevertheless least ressource consuming way. E. g. I could put a loop in the VBA code of MS Access to do something (e. g. DoEvent) until it is 6 a.m. But this might slow down the computer. The computer is already busy with other tasks. Thus the way of triggering the module/ function in MS Access should be as little CPU comsuming as possible. Anyone who could help, please?
Use the task scheduler to run the application and specify a macro name on the command line (see on-line help for instructions).
...you could also name your macro AutoExec and it will run every time the MS Access database is opened.
Windows Task Scheduler to the rescue!!
https://www.howtogeek.com/123393/how-to-automatically-run-programs-and-set-reminders-with-the-windows-task-scheduler/
I am trying to utilize windows task scheduler to distribute Access reports to End Users in my company.
All I am doing is triggering a macro that runs code from a module which exports a report to a PDF, prints it out, then exits access.
DoCmd.Quit acQuitSaveNone
That's what I've been using at the end of my code in VBA to close access after running a macro.
When I manually run the macro it works fine, but when scheduled on a task, it gets held up a lot and stuck.
I've checked event viewer to try and find any Microsoft Office alerts but do not see any.
It appears that Access is unable to quit many times when running through Task Scheduler. Would there be a VBS I can run, say, 5 minutes after the task to close down the .accdb file and MSACCESS.EXE or is there something I can do to make these Tasks actually work??
It seems maybe when running in the background through task scheduler.. the code is getting ahead of itself and trying to quit at the same instance that it is finishing the output to the printer, causing it to seem "busy" and unable to actually close?
I have an entire domino of code that shoots off after this but it stops dead in its tracks when it cannot finishing closing access.
Any suggestions?
Thanks,
Ian
Here is the gist of what I would do, I am just addressing the print on open and quit actions. You may need to tweak to ensure that you have validation etc in place.
First, make sure that your report has a default printer specified. (Report design-->Page Setup-->Page-->Use Specific Printer and then select your printer)
Create an Autoexec (auto execute) macro, this macro will be saved with the name Autoexec. Macros named Autoexec executes when Access is opened automatically. Note that once you have this macro, it will run each time you open Access, to prevent it from running, hold down the shift key and then open Access, this bypasses the Autoexec
First action in your Autoexec Macro is OpenReport and set the View to Print (report is printed when opened)
Next action in your Autoexec Macro is QuitAccess with options set to SaveAll.
When you run an application from the scheduler, it runs with different credentials. You want to make sure that you choose the appropriate options here.
Fixed it. Very glad as I've seen many with this issue and hope this gets to them.
If anyone has any issues regarding access macros and task scheduler and this doesn't work - I'll be happy to help as best as I can as the frustration of wanting to remove administrative tasks through automation that don't work out is just terrible.
Since I needed the task scheduler to wake the computer up, log me in, and open access databases on network drives that reference SQL servers.. there was a couple things I had to make sure were set up.
First is trusted locations. Any network drives you are access should probably be in the trusted locations.
Secondly, my last command on the macro is DoCmd.RunCommand.Close (I believe.. if im wrong Ill change tomorrow when I'm back in the office)
Third, use the root path to the network folder and not a mapped drive as they may not map when your logged off... so instead U:\file path... would have to be \computer1\filepath\ etc..
This path should be made with all linked tables or databases among the network especially if you have code calling for those files.
Fourth, I ended up having to do it the less preferred way and have a folder called "accessjobs" where I put shortcuts to Access Macros which triggered code and simply ran that path in task scheduler with "start in:" the folder the macro shortcut is in.
Fifth I had to run with highest privileges, and selected "run whether user is logged on or not"
A couple of these things may be coincidental that they work, but I am not about to spend even more time with trial and error to see which settings are benine as I spent TOOO long figuring this all out. But now it is solved and the sky is the limit now!
Thanks for the help!
Ian
I've got an Access VBA application that is responsible for querying a SQL table once per second over ODBC, looking for records where processed = 0. When it finds one, it will process an Access report and print it to PDF using CutePDF, saving it to a network drive that our desktop application (that added the SQL record with processed = 0) can access, opening it on the user's desktop.
I've spent considerable time debugging this, my first VBA application, and have all errors being trapped & logged. This morning, the Access application was closed, so no reports were being processed. Opening the .accdb allowed the backlog of reports to begin processing. The error log is empty, and the server has not rebooted in nearly a month.
As far as I know, this application should ONLY be run from a desktop, so an administrator must log into the server after a reboot. I've read that running MSACCESS as a service is a "terrible idea" and exposes Windows to corruption if Access errors out.
That's the state of things. Here are my questions.
Is there a pre-written application you would recommend that I install
on this server to monitor & log the events of the application
(particularly, exits & opens)?
As a last resort, I suppose I could
add a function that, every 10 minutes, writes to a "status log" text
file that basically says, "I am here!" so that I can at least find
out WHEN an app closed, if not WHY. This seems like overkill, as the log file could grow enormous unless I create & destroy it every 5-10 minutes instead of appending it.
You'll have to forgive me, prior to this app I worked exclusively on PHP & JavaScript, and haven't taken a Visual Basic or C-based class since college 6 years ago.
Any creative solutions?
My 1st thought is use the Profiler to capture what you need.
Does your app reset the processed = 0 flags when the reports are created?
You could have a 1 record table with a 'last processed' date field, and just update that everytime it runs.
Our company has a huge nasty report that takes about 50-60 minutes to run (it's for a university and lists all sorts of payment information for all students registered in courses). While it has been running each morning at 5am as a subscription, it recently stopped working and displays "An error has occurred during report processing." in the properties window for the subscription.
If I manually run the report from inside Visual Studio it will work every time, but the subscription will now always fail. I had our DBA turn on trace logging and it gave us no helpful information whatsoever. I've also set the subscription to run at different times throughout the day, with no success. The report is supposed to put an Excel file on a file share and it works for the other 5 subscriptions to this report (I have 6 subscriptions, only 1 of the 6 has a parameter set that returns values from a larger dataset). So this means that it has permission to write to the file share. Any ideas?
Could it be trying to write more than 65536 rows to the Excel file? If so it will just fail.
Also you might check the configuration for IIS to see if the report is causing a timeout.