Close Database Function?

P

PcolaITGuy

I want to use task scheduler to open an Access DB, run a macro that updates a
table from an external source, then close the DB and Access. I do not use
any forms on this database, just one table and one macro.

So I guess my needs are as follows:
1. Automatically execute 'My_Macro' when the DB is opened from Task
Scheduler. My Scheduled Task uses the /X switch to specify and execute the
Macro - my main problem is determining how to programatically close the DB
and Access. I would like to continue using the command line method of
executing the macro if possible so that I can manually open the database
easily to do administrative tasks.

2. Once all macro operations are completed, automatically close the DB and
the Access program.

Your suggestions are greatly appreciated!!!!

Scott
 
J

John W. Vinson

2. Once all macro operations are completed, automatically close the DB and
the Access program.

Just put

Quit

in the action of the last step of the macro.

John W. Vinson [MVP]
 
B

Bob Quintal

I want to use task scheduler to open an Access DB, run a macro
that updates a table from an external source, then close the DB
and Access. I do not use any forms on this database, just one
table and one macro.

So I guess my needs are as follows:
1. Automatically execute 'My_Macro' when the DB is opened from
Task Scheduler. My Scheduled Task uses the /X switch to specify
and execute the Macro - my main problem is determining how to
programatically close the DB and Access. I would like to continue
using the command line method of executing the macro if possible
so that I can manually open the database easily to do
administrative tasks.

2. Once all macro operations are completed, automatically close
the DB and the Access program.

Your suggestions are greatly appreciated!!!!

Scott
Create a new macro, that has 2 steps: the first is RunMacro with
your existing macro as the macro to run, and the second step
executes the Quit action. Save your macro as My_Macro_CloseDb.

Change the /x parameter to the name of the new macro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top