Microsoft Access - Is there a way to create a macro that is available to all dbs

Asked By Nancy Ziese on 25-Jun-12 12:50 PM
I want to create a macro that is saved in such a way that it is available to all databases.  Is this possible?  I want the macro to run a query to create a table in a db  and run a saved import process.
wally eye replied to Nancy Ziese on 25-Jun-12 02:28 PM
You can create the macro in a utility database, then reference that database within the VBA IDE.  First create the database containing the original macro and save it.  Then, in a database where you want to use the macro, go to the VBA IDE (alt-F11), select Tools, References from the menu, browse to your new utility database and select Open to bring it back to the References dialog.  It should be checked in the dialog, just click OK to return to the IDE.

Once it is referenced, you can just call its procedures and functions from your referencing database via VBA, in queries, reports or forms.