autoexec a command button

J

JD

I have a button on a form that runs about 50 queries when it is pressed. I
am changing my format and no longer need to use the form, but would like the
button's code to execute when the database is opened. I have had very little
luck figuring out the runcode macro. I am unsure how to go about writing a
formula that calls a sub. Any help would be greatly appreciated! Thanks a
million!
-JD
 
J

Jeanette Cunningham

Hi JD,
to write a function that calls a sub - here is an example for a sub called
RunMy50Queries

Private Function fnRunMy50Queries()
Call fnRunMy50Queries
End Function

In your macro you use the function called fnRunMy50Queries.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeanette Cunningham

Oops - a typo.

That should have read

to write a function that calls a sub - here is an example for a sub called
RunMy50Queries

Private Function fnRunMy50Queries()
Call RunMy50Queries
End Function

In your macro you use the function called fnRunMy50Queries.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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