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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Make Macro Execute upon Startup 1

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,051
US
I have a Macro, which runs a SQL Statement against some linked tables, which I want to make run upon start of the application. I am using MS Access 2000. Does anyone know how to do this?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
dgillz
You could either execute the SQL at startup (see Tools>Startup)

Or, if you have a Switchboard that opens at startup, you could put the SQL in code to run from the Open or Load or Activate event when your Switchboard opens.

Tom
 
I have been all over tools->startup, but I don't see anywhere to execute a SQL statement or to run a Macro. What do I choose one I get to tools, startup?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
If you are going to do it that way, you will have to do it something like this...

1. Put your SQL procedure in the Open event of a form.
2. Have that form run at Startup.

Alternatively, you could put the SQL procedure in a Module that is called from the Open event of the form that is run at Startup.

Tom
 
How do I link the SQL to the open event of the form?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Two ways you could do it...

1. Put the SQL in VBA code behind the Open event on the form.

2. Or since you already have a Macro, put this behind the Open event on the form...
DoCmd.RunMacro "MacroName"

Tom
 
Got it working now.....Thanks a million and a star.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top