Setting up Hyperlink (1 Viewer)

rschnabl

Registered User.
Local time
Today, 06:59
Joined
Jun 10, 2004
Messages
11
I am using Access 2002. I have set up a folder on corporate network that has .pdf and .xls of all my incoming inspections. I enter into Access database all part numbers of the inspections that I require. It runs a report that shows all the inspections for inspectors. When inspectors enter the inspections they have to create a hyperlink to go to the inspection (.pdf or .xls). This hyper link always goes to the same place on the server. Would it be possible to just have the inspectors enter the part number in the hyperlink field without entering the entire location of the file and editing the hyperlink? This is example

Z:\My Documents\Inspections\

The file name would be 123456R3.

I would want to just put 12456R3 in the field and the link would be complete. Am I clear?
 

dkinley

Access Hack by Choice
Local time
Today, 08:59
Joined
Jul 29, 2008
Messages
2,016
Yes. Store the directory name as one variable and the file name as another (or standard control reference). Then simply append (concatenate) the file name for the hyperlink using '*'.

HTH,

-dK
 

rschnabl

Registered User.
Local time
Today, 06:59
Joined
Jun 10, 2004
Messages
11
Can you explain more? I do not have a clue. Thanks a bunch...
 

dkinley

Access Hack by Choice
Local time
Today, 08:59
Joined
Jul 29, 2008
Messages
2,016
Here is an example that I use ...

Code:
Dim sFileName As String
 
Application.FollowHyperlink Environ("USERPROFILE") & "\Desktop\" & sFileName

In this particular case, I have assigned the variable sFileName the name of a file that is located on the user's desktop and concantenated the directory using the & symbol so the system will know the path and file name to call.

Here is an another example where I have used a command button to open a particular folder on a network share ...

Code:
Dim sDir As String
Dim sAppName As String
 
sDir = "\\LS3\userdrive\Departmental Information\Operations\Systems Management\Site\" & Me.txtSiteName
 
sAppName = "Explorer.exe " & sDir
Call Shell(sAppName, 1)

In this one, I have assigned the path which would be the same for all users and no matter the case. The correct folder is opened because of the concantenation (&) of the site being referred to on the form (Me.txtSiteName). The directory structure is automated so the folder name is created the same as the site name.

HTH,
-dK
 

Users who are viewing this thread

Top Bottom