Solved

Create a hyperlink in Microsoft Access Databebase table.

Posted on 2014-12-09
7
511 Views
Last Modified: 2014-12-11
I have created a table that has a hyperlink field in it.  I have created a query that creates a string of data that represents the hyperlink.  I am able to update this information into the table.  The hyperlink is blue but when I edit the hyperlink it has not created and address for the hyperlink.  How can I accomplish this.  

Thanks so much.
0
Comment
Question by:fasse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 400 total points
ID: 40490093
I generally avoid hyperlink data fields in favor of text fields.  Then I use either the double click event of the field, or a command button beside the field to actually follow the hyperlink using the  Application.FollowHyperlink method.

One of several problems with the hyperlink datatype is that it is hard to query and edit.
0
 

Author Comment

by:fasse
ID: 40490102
I will think more about that.  I am travelling today so I will try it tonight and see what I think.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40490213
I am with @Dale Fye on this.
Only Access can deal with the hyperlink field, so the minute you look to do something with the backend other than Access, you have to take the hyperlink field apart back to it's constituent parts, which are basically
<A href="http://www.someplace.com">here</a> transformed into
here#http://www.someplace.com#

Now, you don't want the end-users in the tables anyway -- so what's the point of the hyperlink there?
Not much!
Now, since you need both the anchor and the address in separate fields, it's not much hassle to throw the 'here' into a visible textbox, the 'http://www.someplace.com' into a hidden textbox and have a command button that  does
Application.FollowHyperlink Me.HiddenControl.Value

It will be more robust over the long-term as @Dale Fye has alluded to.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:fasse
ID: 40490592
That makes sense so even if a I have multiple hyperlinks, when I click on the hyperlink I code that uses that  variable to change the hidden field then open the file.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 40490967
I agree with Dale and Nick - don't use Hyperlink data types. They are yet another bad design idea intended to make Access more "Excel-like".

As the others have said, use Application.FollowHyperlink to do this. FollowHyperlink depends on the file extension, and the Windows File Association data, to determine what to do with the file. So if you have this in the field:

C:\SomeFolder\SomeDocument.doc

And you have Microsoft Word associated with the "doc" extension, then Access will attempt to open that file using the current version of Word.
0
 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 50 total points
ID: 40491838
That makes sense so even if a I have multiple hyperlinks, when I click on the hyperlink I code that uses that  variable to change the hidden field then open the file.

There are many ways to do it.  You can have textboxes on continuous forms with command buttons.
You can have a combobox that binds the anchor and link fields, with the width of the link field being zero, and then have the AfterUpdate event pull that .Columns(x) value and do the link.
Ditto for a listbox.

If you look at Application.FollowHyperlink you will see that for filesystem links like Word documents, you can have the document opened to specific bookmarks.  Lots of ways to do it.
0
 

Author Closing Comment

by:fasse
ID: 40494052
Thanks guys it works great.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question