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 / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

How to store folder path as Hyperlink?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deko - 26 Dec 2005 20:37 GMT
I have a subform datasheet which holds hyperlinks to documents stored on
local disk.  Each database record has a series of documents associated it.

The link is stored in the table like this:

   resource.doc#file:C:\LinkedDocuments\resource.doc#

The problem is when users want to link a folder:

   ResourceDocs#C:\LinkedDocuments\ResourceDocs

When users click on this link, Windows Explorer opens the folder, but a
second explorer window is also opened - showing the root C:\ drive.  Why the
two explorer windows?  Any way around this?  I tried a trailing "\" but no
luck.

Thanks in advance.
pietlinden@hotmail.com - 27 Dec 2005 05:01 GMT
any reason you can't store as regular text and format it as a hyperlink?
deko - 27 Dec 2005 05:05 GMT
Where Me!Document = ResourceDocs#C:\LinkedDocuments\ResourceDocs#, this will
open Windows Explorer properly and display the contents of the ResourceDocs
folder:

   strSysRoot = Environ("SystemRoot")
   strExplorer = strSysRoot & "\explorer.exe"
   strExplorer = strExplorer & " " & HyperlinkPart(Me!Document, acAddress)
   Call Shell(strExplorer, vbHide)
Ted - 27 Dec 2005 05:09 GMT
Why use a Hyperlink to open the file? Why not just store the path and
filename and then open the file using the following:
Dim RetVal As Variant
   Dim stFile As String
   stFile = DLookup("[DataPath]", "tblApplicationInfo") & "CutSheets\"
& Me!FileName
   RetVal = fHandleFile(stFile, WIN_NORMAL)

Note that I only store the file name in the field, and use a reference
to where the files are located in a table called tblApplicationInfo
where I store information about the application.
In this example, the file (an Excel file in this application) is stored
in a subfolder of the folder listed in the DataPath field so it is
added to the string in the appropriate location. The Me!FileName refers
to the name of the file on the form.
This code will open any file you tell it to, as long as the
corresponding application is installed on your computer (example: Word
must be installed to open a Word Document, or a paint or image editing
application to open a JPG file, etc.).

Ted
 
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.