autoexec a command button

  • Thread starter Thread starter JD
  • Start date Start date
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
 
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
 
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
 
Back
Top