Application level Autoexec

  • Thread starter Thread starter JohnV
  • Start date Start date
J

JohnV

I like the Autoexec feature of the macro. The only
problem I see is that it is database dependent. Does
anyone know a way to force the Application to run autoexec
whenever it is opened? We have some general maintenance
code that we would like to be run everytime but we have
many dozens of databases.

Thanks,
JohnV
 
I think my post was not too clear in what I am trying to
accomplish.

What I am wondering is if there is a way to not have to
create an autoexec file for every database, but rather
have it set at the application level?

Additionally, is there a way to have a code module linked
to the application? This way whenever a database is
opened it will automatically run a specific piece of
code. My code resides in a Library that all the users
have a reference set to. There are a finite set of users
but dozens of databases. I do not want to have to go
through each database and set the reference to the
Library. Also, whenever a new database is created I would
rather not want to have to set the reference and create a
macro each time.

I am trying to avoid the pain of checking on all the
database that these users create by trying to dummy proof
Access. I hope this explains a little more. I know this
opens the question to is this the best practice? Any
thoughts?

Regards,
JohnV
 
Sorry, not internally in Access since the (VBA) code execution doesn't
commence until you open a database file.

What you can do is to create a blank data with the AutoExec Macro and the
Reference to the Library as the database template. Ask the users to get a
copy of this database template, rename it to whatever they like as the
starting point for a new database rather than a blank database from Access.
All databases create from this "template" will have the AutoExec Macro and
the reference to the Library.
 
Back
Top