Tweek code to give just the path

  • Thread starter Thread starter Stephen sjw_ost
  • Start date Start date
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.
 
Back
Top