There are two things I'm gathering here. You want to select a directory and have that path returned as a string. You also may want the user to be able to browse for a file and return the entire path including file as a string. Here's the code for the browse dir fuctions - this will return a string with the path of the directory chosen.
'Call this function with something like
'Dim dirPath as String
'dirPath = Pickfolder(c:\)
Function PickFolder(strStartDir) As String
Dim SA As Object, F As Object
Set SA = CreateObject("Shell.Application")
Set F = SA.BrowseForFolder(0, "Choose a folder", 0, strStartDir)
If (Not F Is Nothing) Then
PickFolder = F.Items.Item.Path
End If
Set F = Nothing
Set SA = Nothing
End Function
If you want the code for browsing for files, It's availabe on Ben Ohara's website. His user is OharaB if .. I think it's
... He's got some nifty code there for public download. All you need to do is edit it for your needs. Let me know if you can't find his website.
------------------
'How to Keep Your Databases from becoming Overwhelming!' thread181-293590
joshua.peters@attws.com
------------------