Tweek code to give just the path

S

Stephen sjw_ost

Hello again,

I am using the code from this article;
http://www.mvps.org/access/api/api0001.htm
It works like a charm, however, I would like to be able to use this code to
identify just the path. Here is the part that is working fine that I was
hoping to tweek. I want the result to be just the drive path.

Function GetFile1()
Dim strFilter As String
Dim loc As String
strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _
"*.MDA;*.MDB")
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)", "*.XLS")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

Form_f_GetFileandLocation!LocationFile1.Value = _
ahtCommonFileOpenSave(InitialDir:="G:\OST\References\")
loc = Nz(Form_f_GetFileandLocation!LocationFile1.Value)
Form_f_GetFileandLocation!FileName1.Value = Mid(loc, InStrRev(loc,
"\") + 1)
End Function

I copied then modified the TestIt, as shown above, to put the full path and
filename into text boxs. Now I also have a need for a separate function that
will provide just the drive path.

Can someone help me with this please?
Thank very much
Stephen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Tweeking API Code 2
File Box 6
Importing excel file using VBA 6
Error 3061 - too few parameters 2
error message 2465 5
Update Link Tables 1
Error Handling on using Common Dialog... 2
Error 3073 with TransferText 7

Top