Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing and retrieving file paths

Status
Not open for further replies.

pyroskliq

Technical User
Jan 17, 2001
29
US
I am working on a database with some export/import functions. I need to be able to have the user specify the export/import directory once, and store this information in a table, then each function needs to retrieve those paths from the table each time they run.

I've searched all over for code or examples, and can't find them anywhere.

I'm currently using this function to get the directory that the .mdb file is in, then importing/exporting to a directory under that:

Function CurrentDBDir() As String
Dim strDBPath As String
Dim strDBFile As String
strDBPath = CurrentDb.Name
strDBFile = Dir(strDBPath)
CurrentDBDir = Left(strDBPath, Len(strDBPath) - Len(strDBFile))
End Function

So if my file is in "C:\Test\" then I export to "C:\Test\exported\"

What I'd like to do is be able to specify my export directory as "R:\exported\" by allowing the user to input this on a form and save it to a table.

Sorry if my terminology is confusing...I still consider myself pretty green when it comes to VBA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top