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
Douglas J. Steele - 24 Sep 2006 12:41 GMT
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.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Appologies for the two previous unneccessary posts, after going back to
> the
[quoted text clipped - 27 lines]
>
> End Function
Duncan SW8 - 24 Sep 2006 16:45 GMT
Many thanks, I spent so much time searching for an answer which was staring
me in the face the whole time.
scubadiver - 30 May 2007 14:07 GMT
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
> You're looking at the wrong example on that page.
>
[quoted text clipped - 41 lines]
> >
> > End Function
scubadiver - 30 May 2007 14:25 GMT
I've created a new thread
> You're looking at the wrong example on that page.
>
[quoted text clipped - 41 lines]
> >
> > End Function