Solved

Create a hyperlink in Microsoft Access Databebase table.

Posted on 2014-12-09
7
425 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
7 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 400 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:fasse
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks guys it works great.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now