Run a macro from another database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know if it is possible to run a macro from another database. For
example I want to run a macro which is located in Database A from Database B.

Any help is appreciated.

Thanks,

Sarah
 
You can use reference from MDB1 to MDB2, so MDB1 will recognise all the
functions in MDB2.
Open MDB1, when you are in code (any where), select tools, reference. browse
and select MDB2.
You will notice that MDB1 recognise all the functions, but it wont recognise
forms, reports, macros etc, so if for example you want to run a macro in MDB2
From MDB1, create a function in MDB2 that run the macro, and then call that
function from MDB1.
 
In Mdb2 create a function in a module.

Function FunctionName()
Docmd.RunMacro "MacroName"
End Function

In Mdb1, add reference to Mdb2
Now any where in Mdb1 if you run the FunctionName() created in Mdb2 it will
run this function, and the function will run the Macro
 
How do I call it from db1? I did the reference but dont know that much about
code. Can you help? Thank you
 
Back
Top