AutoExec SUB dosn't work

  • Thread starter Thread starter Jeppe A
  • Start date Start date
J

Jeppe A

Hi all!

I'm trying to execute some code through ACCESS 2003 at startup but the
AutoExec SUB dosn't fire. Ant suggestions?

Thanks ALOT!
 
Unless things have changed, you have to create a macro named Autoexec
which actually executes your code.
 
AutoExec SUB? If you're referring to the "AutoExec" that ACCESS will run
when it opens a database file, that is a macro that you create and name
"AutoExec". It's not a subroutine.
 
That's right,

and if you want to run code from the autoexec macro (you have to name it
autoexec), you can only use functions and not subs to be run.

Regards

Oliver Seiffert

Ken Snell said:
AutoExec SUB? If you're referring to the "AutoExec" that ACCESS will run
when it opens a database file, that is a macro that you create and name
"AutoExec". It's not a subroutine.
 
If I'm not mistaken, any function or sub can be run from the AutoExec
macro regardlesss of how the module is named. The macro, however, must
be named AutoExec.

Oliver said:
That's right,

and if you want to run code from the autoexec macro (you have to name it
autoexec), you can only use functions and not subs to be run.

Regards

Oliver Seiffert

:
 
Douglas J Steele said:
I believe Oliver is correct. Macros can only run Functions, not Subs.

Yep. And the macro ignores the value returned by the Function.
 
For what it's worth and at the risk of stating the obvious...

Even though you can only run a function from a macro, you can always call a
sub from the function...
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office
 
Wether or not the SUB answers the call is of course another matter. (The
SUB could be in the shower or otherwise indiposed.)

Not entirely drunk at the momement.
 
David C. Holley said:
Wether or not the SUB answers the call is of course another matter.
(The SUB could be in the shower or otherwise indiposed.)

Not entirely drunk at the momement.

I can call SUBs from the vasty deep!

Why, so can I, or so can any man, but will they come?
 
If you call them, they will come. (Especially if you ask them nicely and
promise not to give them one of my Grandmother's fruitcakes.)
 
Back
Top