Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2007

Tip: Looking for answers? Try searching our database.

Path & Filename

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Duncan SW8 - 24 Sep 2006 02:26 GMT
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
Duncan SW8 - 24 Sep 2006 04:28 GMT
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.
Duncan SW8 - 24 Sep 2006 07:31 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.