How to programatically call a macro in a different (ie. external) Access database using VBA?

I want to use Access Database1 to call a macro in Access Database2.

The link below describes how to call an external macro in a visio program, but the syntax seems to be a little different with Access.

How can I call a VBA macro that is defined in a different file?

Basically, I want to do something like this (from within database 1)

AccessDatabase=pathToOtherDatabase.mdb

AccessDatabase.runMacroA

Does anybody know how to do this?

Answers


You could use the built in Shell command to call your secondary database, and pass it the macro name in the command line switch, this would force your secondary database to execute the desired macro on open. More about Access command line switches can be found here:

http://support.microsoft.com/kb/209207


Need Your Help

How do I open a Finder sidebar folder via AppleScript?

bash osx applescript finder

I have a bash script which will be run on a Mac via ssh. The script requires a particular network drive to already be mounted. On the Mac, I mount this drive by opening a folder "JPLemme" on that d...

HTML Attribute CHtml::link

php image yii

I know there's also another post with this kind of question. But there was no (correct) answer that's why i wanted to open a new one to help me and also other people who want to know this.'