Run A Macro

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

Guest

How can I reference to run a macro, "Macro1", which is in an external
Database, from the current dataabase?

This code effectively opens the external Database:

Dim objAccess As Object, objFunction As Object
Set objAccess = CreateObject("Access.Application")

With objAccess

.OpenCurrentDatabase filepath:=strPathCurrDB & strDB
.Visible = True

*******************************************************
HERE IS WHERE I WANT TO THE THE MACRO1

*******************************************************
objAccess.Quit

End With

Set objAccess = Nothing

THANK YOU !

Ross
 
1. Create a function in a module, in the external MDB that run the macro
2. Create a reference to the external MDb from the current MDB.
3. Now you can run the function you created in stage 1 from the current mdb.

using reference you can run only function created in the other mdb
 
Back
Top