Path & Filename

G

Guest

I've been browsing through some of the previous questions however I still
can't quite find what I'm looking for.

I would like to store the path and filename of various documents in a table.
Users should be able to browse windows for files and when they select a file
the path and Filename of the file should be copied to the relavant text boxes
on the form.

Thanks in advance
Duncan
 
G

Guest

Maybe a better way of explaining it is as follows;

I would like a save/open dialog box to act in the same way as a combo box
does but in this case the value would be the path and file name.
 
G

Guest

Appologies for the two previous unneccessary posts, after going back to the
"The Access Web" as suggested in other threads, I discovered the following
code almost does what I'm looking for. Instead it displays the file name etc.
in a message box.

http://www.mvps.org/access/api/api0001.htm

I've tried to customize but I can't locate the string refring to the file
name without re-opening the FileOpenSave dialog.

Also can the dialog box be customised to show Select as opposed to Open



Function TestIt()
Dim strFilter As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _
"*.MDA;*.MDB")
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
Debug.Print Hex(lngFlags)

End Function
 
D

Douglas J. Steele

You're looking at the wrong example on that page.

Look at the very top of the page:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
strInputFileName contains the full path to whatever file was selected.
 
G

Guest

Many thanks, I spent so much time searching for an answer which was staring
me in the face the whole time.
 
G

Guest

Hello,

I have looked at Arvin Meyer's Document management database where I can
browse for a directory and insert it into a field.

I see yours can browse for files but I would like to know how it might be
possible to insert a full file path and name into a field.

thanks
 
G

Guest

I've created a new thread




Douglas J. Steele said:
You're looking at the wrong example on that page.

Look at the very top of the page:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
strInputFileName contains the full path to whatever file was selected.
 

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

Top