Topics Search

Running a query / macro through scheduled task

Running a query / macro through scheduled task
Views: 312
I have a MS Access append query that updates a table from a linked Excel spreadsheet.
I'm trying to automate the running of the query during the night.

I've tried a couple of ways to schedule the task with Windows Task Scheduler, although each time, it appears to start the job, but then just hang (task never completes, doesn't run the queryor macro and when I log back into Windows, the msaccess.exe process is running).

Methods I've used are:
Sponsored Links:

Similar posts...

 

Create an Outlook task for an Access macro

Create an Outlook task for an Access macro Icon
I have an Access macro that runs a function to run a query and export it to my C: drive as an excel spreadsheet. I would like to have a task on my outlook to run this macro. It is not scheduled, it needs to be able to be run on demand.

I know I can create the outlook task from a Saved Export, this macro also has to run the query that has a user inputted date parameter.
 

Need to automatically close Access

Need to automatically close Access Icon
I have a Microsoft scheduled task to open MS Access, and my DB, and run a macro that runs a query, and updates a table several times a day. This is on an unattended computer that runs 24X7. The problem I am having is getting Access to close. I can close the access DB via the macro, but can't seem to get anything to work to close Access itself. Since access is not closing - the schedular still shows my job as running, and will not run at the next scheduled time. I have seen referances to Application.Quit and DoCmd.Quit, but I can't get them to work in my macro in my Access DB (I have fair Access knowledge, but no VB knowledge, and haven't worked with macros very much
 

Error 2950 In A2007 in AutoExec Macro From Trusted Location

Error 2950 In A2007 in AutoExec Macro From Trusted Location Icon
I'm running Access 2007 on a Win XP box. I have a make table query to create a local table from linked Oracle tables. I have been running this successfully for a couple months in a trusted location from an AutoExec macro via a scheduled overnight job.

I recently started receiving a 2950 error when running the query from the macro, but when I run it manually itcompletes successfully.
 

Macro sending report twice instead of once

Macro sending report twice instead of once Icon
I have a macro which sends a report from Access, I used the Scheduled task to run the macro on a specific time everday. I Placed the below code in the Timer() Event of the main form. the macro is running fine but the reports are being sent twice.?

Static intCounter As Integer
Private Sub Form_Timer()
If intCounter > 1 Then
Me.TimerInterval = 0
DoCmd.Quit
Else
DoCmd.RunMacro "mcrTest"
End If

intCounter = intCounter | 1
End Sub
 

Macro Sequence

Macro Sequence Icon
When a macro runs, does it wait for the previous step to finish before beginning the next? In one macro I have it runs a query that takes a little time to run due to the large number of records. I want to close the database when the macro is finished running (this is an automated task that runs when I am not here) but I don't want to add this step if it is going to try to close in the middle of running the query
 

Executing Access macro

Executing Access macro Icon
I execute an access macro from a batch file. I use this command:

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" file.mdb /x Import /nostartup

The macro is executed correctly but I see always that access window starts, even if I use /nostartup command. How is possible?

the second problem is about what happens when the macro gives an error.
I would like that in every case msaccess process is killed. This macro is scheduled in windows task, so every morning when I open task manager, I see a lot of msaccess.exe processes.

So I would like to know how to force the killing of access process when the work is ok but also when it's not ok. Now I use the "Quit" command inside macro. I see also a lot of other commands but I don't know which is better to use

last thing: is it possible to wite the result of the macro executed by access in a log file? If not how can I know if the macro is ok or not
 

2010: Exit with status code for Windows Task Scheduler

2010: Exit with status code for Windows Task Scheduler Icon
I'm running an Access 2010 macro from Windows Task Scheduler. For various reasons, the macro might fail, in which case I'd like Windows Task Scheduler to retry starting the task a few minutes later.

To achieve this, when my Access code quits I need it to return a status code to tell Windows Task Scheduler whether it succeeded or not. (I think the codes are 0 for success or -1 for failure.)
 

Macros - Use Macros to automate your work in Access!

Macros - Use Macros to automate your work in Access! Icon
If you find yourself doing the same routine task over and over again, you might want to consider creating a macro to complete the task for you. A macro helps you perform routine tasks by automating them. Instead of manually performing a series of time-consuming, repetitive actions, you can record a single macro that does the entire task all at once for you.
 

Run macro automatically Access 2003

Run macro automatically Access 2003 Icon
I have a macro, when clicked, will export a query into a file location as xls format.

I would like the macro to scheduled to run automatically. So if I left access open, I would like the macro to run at 07:00am in the morning.

I searched for this and someone (not on this forum) advised if I add the wherenow()>"07:00am" it should run automatically. I have tried this, but does not work.
 

How to you tell Access 2010 to run VBA code?

How to you tell Access 2010 to run VBA code? Icon
I started with creating a Macro in Access 2010 which is very repetitious (open a query, update and close. move to next query). I used the Macro builder to make sure I got the right code commands and then converted to VBA because it is my understanding running code is better than running a macro (but I still haven't seen anything thatexplains to me why that is so).