View Full Version : Universal File Paths


AMAI
09-25-2008, 11:32 AM
Hi Guys,

Thanks in advance for any information anyone could give me to help with my problem.

Here is my issue:

I have a database in access 2003 that imports and exports alot of excel and txt files to folders within my main database folder called 'Updates' and 'Exports'.

I wrote macros to control the import / export functions with the path to these folders and everything works fine. Only problem is now my users need to be able to run the database for multiple projects with multiple datasets now.

Does anyone know of a way to change the file path string in a macro that tells access to start the path in the directory that the actual application file resides?

If I could do that then they could just copy the database to a new folder for each project they want to run on that system.

Any help with this would be greatly appreciated!

Thanks!

Dan

DCrake
09-26-2008, 04:46 AM
You can use either

App.Path or
CurrentProject.Path

Either one identifies the current location where the front end resides. Simply add on the "\Updates" or "\Exports" to the path. This will ensure that the files are stores in the correct place irrspective of where the application is installed.

CodeMaster:cool::

AMAI
09-26-2008, 02:33 PM
Works great!

Thanks alot!