Solved

Access 2010 Hyperlink in Listbox

Posted on 2013-06-25
4
1,491 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

895 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

18 Experts available now in Live!

Get 1:1 Help Now