Run A Macro

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top