Solved

Create a hyperlink in Microsoft Access Databebase table.

Posted on 2014-12-09
7
487 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

808 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