How do you specify to open another database in the SAME folder

chillwa

New member
Local time
Yesterday, 23:37
Joined
Jun 16, 2008
Messages
7
I have some code that needs to open another database in the same folder as the current database.


I have two databases that will be located in the same folder.
I do not want to hard code the location because the location can be changed.

I need to open a database called order1.mdb which this code is located in a database in the same folder as the order1.mdb database



Here is the code:

set db2 = Opendatabase("Order1.mdb")



this use to work, when I had both databases on my desktop. Now that I put them into a folder, I'm getting the error message, cannot locate database.

How can I specify that this order1 database is in the same folder as my open database??? I use to know, but I forgot.
 
I found it thanks

set db2 = Opendatabase (Application.CurrentProject.Path & "\order1.mdb")
 

Users who are viewing this thread

Back
Top Bottom