Hi Rushdi,
This sounded like a fun problem that I've never tried, so I wrote you a method and tested it. You'll want to customize it's response and add some error-handling. I suggest making it a function that returns a boolean so that the calling method can just see if it was successful or not. Enjoy!
DoogieB
PS-I wrote this using Access 2000. If you're using '97 the object model will likely be different, but this will at least give you the general idea.
Public Sub RunRemoteMacro(ByVal strDbPath As String, ByVal strMacroName As String)
Dim app As Access.Application
Set app = CreateObject("Access.Application"
app.OpenCurrentDatabase strDbPath
app.DoCmd.RunMacro strMacroName
app.CloseCurrentDatabase
Set app = Nothing
MsgBox "Macro " & strMacroName & " has been run"
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.