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.
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.