Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlinks not working

Status
Not open for further replies.

thomasks

Programmer
May 12, 2006
113
US
I am saving data from a master worksheet in excel into a database with only one table on the before close event of the worksheet. One of the fields that I am saving to in the database is supposed to be a hyperlink that opens the saved worksheet if you click on it. But it is not working. The field data type is set to hyperlink, and it shows up "blue" with the underline and gives the hand cursor. But when you click on it you only get the web toolbar in access, and it doesn't open the worksheet. If you edit the hyperlink by right clicking on it and following to the filename it will work. Here is the line of code that creates this field:
Code:
rs.Fields("File_Path_Hyperlink") = Application.ActiveWorkbook.FullName
 
Ok, sorry to waste anyones time, but I solved my own problem. Here is the solution that I came up with for anyone elese who may run into this same issue:
Code:
rs.Fields("File_Path_Hyperlink") = Application.ActiveWorkbook.Name & "#" & Application.ActiveWorkbook.FullName & "#"
Hope it helps!
 
I gereally find it best to avoid hyperlink fields, they get more annoying as time goes by. You can use FollowHyperlink to get the same effect, though I would recommend the double-click, rather than the click event.
 
What do you mean by "they get more annoying as time goes by"?
could you give me an example of the followhyperlink you are referring to using the above example I supplied?
Thanks for all the help.
 
They are a nuisance to edit, and, as you have seen, a nuisance to update.

Examples:

FollowHyperlink Application.ActiveWorkbook.Name

FollowHyperlink Me.txtFileName

FollowHyperlink "C:\Docs"

FollowHyperlink "C:\Docs\Pic.jpg"

FollowHyperlink "MailTo:" & Me.txtEmail
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top