DougTucker
Technical User
I need help changing hard-coded file paths to relative paths so my MS Access database will work on other networks or on a local PC. Please let me know if there’s a different forum where this should be posted (it’s specific to MS Access, but not particularly a VBA issue).
Here’s what I have now:
1. Macros use the TransferSpreadsheet command to pull files from hard-coded paths such as “I:\Department Files\DataConversionUtility\SourceFiles”.
2. Queries manipulate the data and format it for use by another application
3. Macros output the data to files (.txt and .xls) to a path such as “I:\Department Files\DataConversionUtility\OutputFiles”
This works great on our local network, but our coworkers in another country need to be able to use the utility. I can ship them a zipped MS Access database, but they don’t have access to our network, and won’t necessarily be able to map an “I:\...” drive as I have.
QUESTION: What is the proper way to create a relative path for the files so the application works properly on anyone’s PC or network?
I envision a structure that would require the user to create a “DataMigrationUtility” folder wherever the user wants it located:
[Path]\DataMigrationUtility\
This path would contain subfolders that the application could create the first time it is launched:
[Path]\DataMigrationUtility\OutputFiles
[Path]\DataMigrationUtility\SourceFiles
[Path]\DataMigrationUtility\Templates (etc…)
Thanks in advance for your help!
~ Doug T.
Here’s what I have now:
1. Macros use the TransferSpreadsheet command to pull files from hard-coded paths such as “I:\Department Files\DataConversionUtility\SourceFiles”.
2. Queries manipulate the data and format it for use by another application
3. Macros output the data to files (.txt and .xls) to a path such as “I:\Department Files\DataConversionUtility\OutputFiles”
This works great on our local network, but our coworkers in another country need to be able to use the utility. I can ship them a zipped MS Access database, but they don’t have access to our network, and won’t necessarily be able to map an “I:\...” drive as I have.
QUESTION: What is the proper way to create a relative path for the files so the application works properly on anyone’s PC or network?
I envision a structure that would require the user to create a “DataMigrationUtility” folder wherever the user wants it located:
[Path]\DataMigrationUtility\
This path would contain subfolders that the application could create the first time it is launched:
[Path]\DataMigrationUtility\OutputFiles
[Path]\DataMigrationUtility\SourceFiles
[Path]\DataMigrationUtility\Templates (etc…)
Thanks in advance for your help!
~ Doug T.