Here's what I use:
Dim acc As Access.Application
Set acc = New Access.Application
acc.OpenCurrentDatabase "fully quallified DB name goes here"
acc.Echo False
GetOfficeOVInfo = acc.Modules("ModuleName").Application.Run("FunctionName",
_
parameter1Here, _
parameter2Here, _
parameter3Here)
acc.CloseCurrentDatabase
Set acc = Nothing
You need to fill in the DB name, the module name that contains the function
you want to run, the name of the function, and then supply any parameters
that may be needed. In m example the function "FunctionName" is located in
module "ModuleName" and it has three parameters that are passed to it. mine
actually returns a value back to the calling DB. I'm assuming this would work
with a Sub also, just use 'Call acc.modules(.....)'