SolvedPrivate

Hyperlink control in Access

Posted on 2014-11-12
7
38 Views
Last Modified: 2016-02-10
Hi,

I have a hyperlink field in a table.
I created a data entry form based on the table.
When I click in the hyperlink control in the form, I need it to open Windows Explorer to locate the file that the hyperlink points to.
I would prefer to do this using a macro as I am not experienced in VBA.
Thanks
0
Comment
Question by:SalmaYK
[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
  • 2
  • 2
  • 2
7 Comments
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40438434
I would recommend changing the field to a short text data type.  The Hyperlink data type is specific to Access and cannot be upsized.

The code to "open" a hyperlink from a text control is:

Application.FollowHyperlink Me.yourtextfield

This method works for web pages, email addresses, and any file whose file type is registered.  So

Application.FollowHyperlink "C:\Data\somespreadsheet.xlsx"  
will open the specified spreadsheet.

I don't know if the Hyperlink data type limits you to just web pages because I don't use it but it may.
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 40438465
No points please.  I strongly agree with Pat regarding changing the data type of that field from hyperlink to text.  In addition to any potential upsizing issues, simply clicking in the control can launch the hyperlink, rather than allowing you to edit the text.  I generally use a textbox, with a command button (use the image of the World with chain on the button), and use the FollowHyperlink method described above in the click event of that button.

It is also difficult to query hyperlink fields, as they contain all sorts of extraneous html codes which get in the way.
0
 

Author Comment

by:SalmaYK
ID: 40438471
ok..
but I do want to open the hyperlink once it is entered if I click on it.
For data entry purposes, I need to be able to search for the location of the file on my hard drive (not a website).
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 37

Expert Comment

by:PatHartman
ID: 40438527
I showed you the code in my previous post.  It's a one liner.  Just put it in the double click event of the field.  Using the click event will interfere with editing the value.
0
 

Author Comment

by:SalmaYK
ID: 40438702
ah.. that was it
Thanks!.
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 40439090
But I think you got the answer wrong.  Pat is the one that provided your solution, I just piled on, and asked for no points.

Please reopen this thread (click the Request Attention text in the bottom right corner of your original post).  Then ask the moderators in the text box provided to reopen the question for re-allocation of points.

Dale
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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 …

691 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