Alex,
Thanks for your response, as the number of sub databases may grow overtime,
and the main database will be an .mde on a client site, I didn't want to go
the references route. I had a go with what you said but that syntax didn't
work for Access 2000. After playing around for a while, have come up with
the following code that works.
Thanks again for the quick response and putting me on the right track.
Best regards
Mark Taylor
Dim oAccess As New Access.Application
oAccess.OpenCurrentDatabase ("C:\MyData_USA.mdb")
MsgBox oAccess.Run("MyFunction")
Set oAccess = Nothing
Quote:
> better add a reference to both subs in main.mde, then you can call public
> functions directly
> alternatively you can use automation:
> set oAccess=createobject("access.application")
> oAccess.opendatabase("...")
> oAccess.Run "MyFunction"
> ...
> Alex
> > Hi,
> > I have three databases (main.mde, sub_a.mde, sub_b.mde) I want to be
able
> to
> > call a function say (MyFunction) from main.mde that resides in both
> > sub_a.mde or sub_b.mde
> > Someone suggested the following code but when tried I got the error
> message
> > 'Method or data member not found'
> > Dim DB as Database
> > Set DB = DBEngine.Workspaces(0).OpenDatabase("sub_a.mde")
> > DB.MyFunction()
> > Any ideas !!!
> > Thanks in advance
> > Mark