Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic Macro's

Status
Not open for further replies.

Noah114

Technical User
Mar 31, 2005
59
US
Is there a way to have a macro run the second the database is open?
 
Can you please tell us what you are exactly looking for?

________________________________________________________________________
Zameer Abdulla
Visit Me
A person who misses a chance and the monkey who misses its branch can't be saved.
 
Every day I need to run a query that dumps infor into a make table. Is there a way to have that query run as soon as I open the Access database. Kinda like when you open an excel file that has a link to a database and you can select to have it update as soon as the file is open.
 
I believe you have set everything to dump the data to the backup db. Only thing you need to run the query as soon as you open the working db.

You could use the first switchboard's open event to run the query.

Here is a code sample that opens a different db and add a record to the table.

________________________________________________________________________
Zameer Abdulla
Visit Me
A person who misses a chance and the monkey who misses its branch can't be saved.
 
An autoexec macro ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV is right to say AutoExec - any macro with this name will, by default, run when the database is opened (as long as the db startup is not bypassed by holding down the shift key).

As an alternative, any other macro can be specified to run at db start by means of the /x command line parameter, e.g. [Location of Access EXE] [Location of db] /x YourMacroNameHere

As another alternative, you could use something like the freeware Access scheduling tool HAL ( to let you schedule the macro to be run at a certain time each day (or on the days of your choosing) - then you wouldn't have to do anything to do your backup data dump other than create the HAL schedule file and include it in you Windows startup.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top