Current vs Default Directory

David Fletcher

New member
Local time
Today, 23:40
Joined
Nov 22, 2000
Messages
9
In Access 97 tools options general there is a setting for the default directory, which defaults to "My Documents".

I have a database which is written on one computer and transferred to another computer, and loaded in a folder of different path and name to the one it was in on the original computer.

Now, when executing VBA code MyFile = Dir(*.*), the system defaults to "My Documents" and not to the current folder, which is the one from which the app is run.

Does anybody know how to do set the default directory to the current directory using VBA??
 
ChDir is no use. The problem is that the folder on the new computer is unknown - it could be anything. The DOS convention is that files are searched for first in the current directory. The default setting is Access changes this. Access defaults to My Documents when the option is blank, and not to the current directory. I need to find a way of overriding or changing the default to coincide with the current directory.
 
i may not understand your question, but couldn't you use the CurDir function to get the path and then use Dir?

rethink
-------
the above suggestion might be useful, however, CurDir will return the dir last used in the common open dialogue. so this could be all over the place depending on how your users open your database.


al


[This message has been edited by pcs (edited 06-09-2001).]
 

Users who are viewing this thread

Back
Top Bottom