I use an opening form and the on open event of that form. If I just
want the procedures to do stuff but don't want that particular form up,
after all the procedures run by the on open event are done, I plop in
Cancel = True.
This does pretty much the same as autoexec.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
In Access 97 (and, in fact, all subsequent versions), you have two startup
options: you can use an autoexec macro, or you can specify a form to be
opened at startup. I'll often use an autoexec macro, though, with a single
command: to run a VBA routine.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"MLH" <CR...@NorthState.net> wrote in message
news:u71jc15esc8npbbif...@4ax.com...
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
As others have mentioned, using the startup form is often the solution. (the
option is in tools->startup).
In some cases, such as a back end file, when users click on it, I give them
a message about not having permissions, and then shut down ms-access. (this
keeps them out of the back end..and no security is needed).
In this case, since I do NOT need a form, nor do I want to use the preferred
startup setting in tools->startup, then I do use a macro.
that macro simples has:
Msgbox
Message : You do not have permissions to run this file
beep: yes
Type:critical
Title Cannot run
And, then the next line of the macro is
Quit
options:exit
So, in the above, I don't have to add a code module, I don't have to add a
startup form. Yet, I get a nice message telling the user they can't use the
back end file. So, in this example, a macro is preferred. No forms, no
modules, and not even a worry about broken refs, or having code to run. The
only thing I needed to add was the above autoexec macro...
you can also use the runcode "action" in a macro, and it can call any
function you have in code....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOO...@msn.com
http://www.members.shaw.ca/AlbertKallal
Never thought of this before... gonna use it ALWAYS now! LOL
SilvrT
Burnaby, BC, Canada