View Full Version : Self Executing Macro


pokspeter
12-05-2009, 10:06 AM
Hello Guys,

I'm new to this forum and I find it fantastic to have a forum like this where people are REALLY knowledgeable on the discussed subject.

To get to my point, here's what I need assistance for:

I've created an access database application in which there's an "AutoExec" macro that runs an action Query to append data to a specific table.

My problem is I want the records to be automatically appended on a regular (Daily or Weekly) basis, but the "AutoExec" Macro I have is only running when I open the Database Application manually.

I've read about some people suggesting that one solution would be to schedule a task in Windows Task scheduler and have it open the database to run the macro on a regular basis.

(For some specific reasons, this solution is not convenient for me, since this database will be moved to third party computers soon, and I don't want to have to instruct anybody on how to schedule a task for automation to work properly.)

Bottom line is, I want my Database application to be completely Autonomous, or on autopilot sort of.

I also read somewhere (with no details) about having a timer function on a form that could run a macro on a given time, or interval, which sounds a lot more interesting to me.

So my question is:
Can anybody PLEASE explain to me, preferably with an example db file, how I can set the database to execute its own macro on a regular basis with no physical intervention on my part, I mean in some sort of Autopilot fashion?

A database file as Example would be very much appreciated.

Best regards...

boblarson
12-05-2009, 10:09 AM
Nope, no way to do it without something running. You would need to either have a scheduled task set up or have another program running which could then kick the access database off, or just have the access database remain open.

ajetrumpet
12-05-2009, 11:43 AM
the best way to do it would be the task scheduler. if the autoexec macro is set to shut the db down after it runs its functions, then the scheduler inside of windows would do fine.

pokspeter
12-05-2009, 01:20 PM
Thanks for your prompt reply,

Ok, I understand something has to be running but is there a way I can link the execution of the macro to some normal user action in the database, such as new records being added to another table?

Here's what I'm trying to do:

The users (Employees) will submit a daily sales reports in one table (TblDailyReports), at the en of each week, the weekly sales reports will be generated with sums of daily reports on a given week, and automatically appended to the (TblWeeklyReports).

So I want to ensure the weekly append operation is done, whether on its own or as a result of another operation.

Thanks...