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

Help with Automating VB code

Status
Not open for further replies.

jpiscit1

Technical User
Oct 9, 2002
44
0
0
US
I have some code I am looking to execute on start up of my Access database. The code enables me to run a DSN-Less connection. It requires the following input parameters:

FixConnections "MyServer", "MyDatabase"

The actual code can be found at:

I am not sure how I would automate this. The code is currently set up in a module. I have tested it (using the debug window and inputting these parameters) and it works nicely. I thought maybe I could use a macro or a put these parameters in the "on load" event of my opening form. But i am lost as to how I proceed. Can someone help?

Thanks


Your limits are only as far as you set your boundries......
 
First make a form. Call it startup (Or anything you like)

in the forms properties, under event, is on load. Put a macro there that calls runcode with your function name.

Then, on the tools menu, select startup. This screen is pretty intuitive, but you tell it the form to use for starrt up.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Actually, I would use code in the On Open event of the form to avoid using macros entirely.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top