I'm trying to open a recordset contained using a different database in VBA6, but said different database just doesn't want to load when I don't use the full path, throwing run-time error 3024, where it can't find the file.
So:
Dim db as Database
Dim db2 as Database
Set db = CurrentDb 'CurrentDb is "MyFirstDatabase.mdb"
Set db2 = OpenDatabase("MySecondDatabase.mdb")
The 3024 is thrown on the second 'Set'.
'MySecondDatabase' is in the same directory as the first, so I shouldn't need the full path.
It DOES all work when I use the full path. But why can't I just use the filename when it's in the same directory?
Thanks in advance.
So:
Dim db as Database
Dim db2 as Database
Set db = CurrentDb 'CurrentDb is "MyFirstDatabase.mdb"
Set db2 = OpenDatabase("MySecondDatabase.mdb")
The 3024 is thrown on the second 'Set'.
'MySecondDatabase' is in the same directory as the first, so I shouldn't need the full path.
It DOES all work when I use the full path. But why can't I just use the filename when it's in the same directory?
Thanks in advance.