Reputation: 95
Hello I have 2 accdb files in one folder, I need to open second file from first file and I have to use relative path. I tryed everything, but nothing works.
Set db = DBEngine(0).OpenDatabase(ActiveDocument.Path & "\Training.accdb")
Set db = DBEngine(0).OpenDatabase("..\Training.accdb")
result: error, missing object
Thank you for your help.
Upvotes: 0
Views: 4252
Reputation: 16796
Use this instead:
Set db = DBEngine(0).OpenDatabase(CurrentProject.Path & "\Training.accdb")
The setting ActiveDocument.Path
, doesn't exists in Access.
Upvotes: 3