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!

start access file by running macro 1

Status
Not open for further replies.

chaoma

Technical User
Apr 17, 2005
101
US
Hi,

I have a weekly report which SQL server export a text file. Then I used MS Access 2000 to prepare my report in PDF format.

I have a macro to import the text file and convert the report to PDF format.

My question is how do I run these macro automatically as soon as access open the file. I am willing to write a VBA code if needed. My goal is to generate the report without any human interaction.

Thank you for any help.
 
I answer my own question.

Just rename the macro to AutoExec

Thank you.
 
The /x command-line parameter allows Access to start and run any named macro, e.g. [Location of Access] [location of db] /x yourMacro will start Access, load your db and run the yourMacro macro.

Alternatively, use a scheduling tool like the Handy Access Launcher ( to do the wrangling with command-line options for you. It also allows you to schedule your macro runs (and comapct and repairs too) at certain times, so you don't have to do anything manually.

Hope this helps.
mp9
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top