Hyperlink - Need Help (1 Viewer)

Zanatos

New member
Local time
Today, 04:44
Joined
May 29, 2007
Messages
7
Hey guys.
I am VERY new to Access, and trying to learn as fast as I can, but I have no idea how to do this.

I have a database, brand new, it will eventually be holding hundreds of docs. Anyway, we have it as a document naming machine. We insert all the data associated with our document, it stores it and gives us a name for the doc, we then save that doc as a pdf with the name given.

After this, we are going to put all the documents in one central folder on our network drive, as follows:

F:\Folder\Access\Documents\*.pdf

So, what I need is to create an automative hyperlink creater, that will take our document name once created, put it on the end of the "F:\Folder\Access\Documents\" and have the hyperlink sitting there ready to go.

One more thing, I need to be able to change my Initial Drive Directory (from "F" to "E") at any point in time, and the switch would have to go through and change every hyperlink.

If anyone can help with any part of this problem, I would appericiate it.

Thanks Guys!

Chris
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:44
Joined
Aug 30, 2003
Messages
36,140
Presuming the code knows the name, it's simply:

"F:\Folder\Access\Documents\" & FileName & ".pdf"

As to the path, I'd highly recommend using a UNC path instead of a mapped drive:

//ServerName/ShareName/FileName.pdf

Otherwise you run the risk of users not using the same drive letter, or not having it mapped at all. With a UNC path, it won't matter.
 

Zanatos

New member
Local time
Today, 04:44
Joined
May 29, 2007
Messages
7
I like the sound of the UNC method, but I keep recieving an Error

"Microsoft Office Access can't follow the hyperlink because it couldn't create the hyperlink object."

I know what's in the "Hyperlink Adress" area is correct because if I switch the "\" to "/" and add my directory, the file comes up without a problem
 

boblarson

Smeghead
Local time
Today, 04:44
Joined
Jan 12, 2001
Messages
32,059
Forward slashes (/) are for web addresses (including INTRAnet) and back slashes (\) are for file structure. To use a hyperlink to open a file, the syntax is:

File:///\\YourServerName\YourShare\YourFolder\YourFile.ext
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:44
Joined
Aug 30, 2003
Messages
36,140
My bad, I reversed the slashes. Try them the other way. I just tested this:

Application.FollowHyperlink "\\ServerName\ShareName\FileName.mde"
 

Users who are viewing this thread

Top Bottom