J
Jason Lim
Dear all,
I am trying to call the Windows dialogue box, select a file, and save
the file name, all by a click of a button. I refer to:
http://www.mvps.org/access/api/api0001.htm.
When the button is click, the event procedure is:
Private Sub cmdSelect_Click()
Dim strStartDir As String
Dim strFilter As String
Dim lngFlags As Long
' Lets start the file browse from our current directory
strStartDir = CurrentDb.Name
strStartDir = Left(strStartDir, Len(strStartDir) - Len(Dir
(strStartDir)))
strFilter = ahtAddFilterItem(strFilter, _
"All Files (*.*)", "*.*")
Me.txtFileName = ahtCommonFileOpenSave(InitialDir:=strStartDir, _
Filter:=strFilter, FilterIndex:=3,
Flags:=lngFlags, _
DialogTitle:="Select File")
-------------------------------------------------------------------------------------------
But, I just want to retrive the file name, not the full path.
Is there any way of doing it?
Please help, as I really know nothing about VBA.
Very sorry, and thanks a lot in advance.
=)
I am trying to call the Windows dialogue box, select a file, and save
the file name, all by a click of a button. I refer to:
http://www.mvps.org/access/api/api0001.htm.
When the button is click, the event procedure is:
Private Sub cmdSelect_Click()
Dim strStartDir As String
Dim strFilter As String
Dim lngFlags As Long
' Lets start the file browse from our current directory
strStartDir = CurrentDb.Name
strStartDir = Left(strStartDir, Len(strStartDir) - Len(Dir
(strStartDir)))
strFilter = ahtAddFilterItem(strFilter, _
"All Files (*.*)", "*.*")
Me.txtFileName = ahtCommonFileOpenSave(InitialDir:=strStartDir, _
Filter:=strFilter, FilterIndex:=3,
Flags:=lngFlags, _
DialogTitle:="Select File")
-------------------------------------------------------------------------------------------
But, I just want to retrive the file name, not the full path.
Is there any way of doing it?
Please help, as I really know nothing about VBA.
Very sorry, and thanks a lot in advance.
=)