Solved

Access 2010 Hyperlink in Listbox

Posted on 2013-06-25
4
1,442 Views
Last Modified: 2013-06-30
I created a table and added a hyperlink record. With the table opened I can click the record and the hyperlink opens a PDF document. I then created a form and added a List Box to the form using the wizard. I used the List Box Wizard to get the values from the table. The record shows when I run the form but when I click on the hyperlink record it doesn't open the PDF or respond to the click. Any ideas what I could be doing wrong?
0
Comment
Question by:rfgraham
4 Comments
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 150 total points
ID: 39276902
That is not a built in function of the list box control.

I regular do what you want using a do this using a sub form in continuous view mode. I format it  to look a lot like a list box.

You could try adding code to the List box's on click event.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 150 total points
ID: 39277513
As HiTech mentioned, I would use the Click event of the listbox and the Followhyperlink method, something like:

Private Sub lst_Hyper_Click

    application.followhyperlink me.lst_Hyper_Click.column(x)

End sub

Then replace the "X" with the appropriate column from the listbox.  If you are only displaying the hyperlink in the listbox, and don't have additional fields in the query that is the rowsource of the list, then you can just use:

application.followhyperlink me.lst_Hyper_Click
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 200 total points
ID: 39287700
<No Points needed>

This is why unless it is absolutely necessary, you may not want to use a "Hyperlink" datatype. (emails are most problematic, because the hyperlink datatype adds specific formatting...)
fyed and THTC's posts will work just fine if the field is a regular text field...

Also note that currently SQL server does not support Hyperlink datatypes, so when the time comes to upgrade, they will have to be redone as text datatypes anyway...

JeffCoachman
0
 

Author Closing Comment

by:rfgraham
ID: 39288529
I appreciate all your input. I have decided to use a Combo Box. The reason for the hyperlink is to make it easier on the user (i.e. not having to access a file in a directory somewhere if they need more information on the topic that is displayed on the UI). I appreciate your input JeffCoachman in regards to SQL server hyperlink datatypes not being supported.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

757 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

20 Experts available now in Live!

Get 1:1 Help Now