Listbox with Hyperlink

JPR

Registered User.
Local time
, 23:58
Joined
Jan 23, 2009
Messages
201
Hello,

I was wandering if you could help me out with this. I have created a table with two fields:

Title (records list name of mostly used web/intranet pages)
Web Pages (hyperlinks of the web/intranet pages in field Title)

The data type of the web pages field is set to hyperlink and I am able to open the appropriate web page from the table.

I would now like to add this info to a list box which will only display the Title.
I was wandering if there is a way that would allow me to click on selected records of the list box and open the appropriate hyperlink.
Thank you
 
you may use Dbl-Click. a single click is the entry on the listbox.
create two column listbox, the title and web page column.
show only the title by setting the column width to 1;0 and the column count to 2.

add code to dbl-click event of the listbox:

Private Sub List0_DblClick(Cancel As Integer)
Application.FollowHyperlink List0.Column(1)
End Sub
 
Thank you Arnel,
I am getting an error (7971) and have noticed that after a security warning that advises about hyperlink from trusted sources, at the beginning and end of the hyperlink I get an #.
Obviously this # are not in the hyperlink. Another think I did not indicate before, is that the list box is used to display several utilities in my program (simple tips for users) and amongst these, there is this web page/Intranet. Thank you
 
you extract the second text from your hyperlink field:

Application.FollowHyperlink Split(Lists0.Column(1), "#")(1)
 
Wow thank you Arnel. It's years I search the web for help on MS Access and have to admit that your replies are fast, easy and have always a solution. Thank you
 
you're welcome.
 
You may want to consider storing your link as plain text since you are already storing the title and the link.
With hyperlink datatype the pound sign (#) seperates the title from the link. Using followhyperlink will still work with plain text.

Another option is to use Shellexecute instead of followhyperlink. This has the functionality to open any path, be it a webpage or a file.
see this link http://access.mvps.org/access/api/api0018.htm
 
I'm with moke123 Colin posted a updated shellexecute that is 32 and 64 bit compatable
I never store hyperlinks.
 
You may want to consider storing your link as plain text since you are already storing the title and the link
I agree also, hyperlinks are just trouble might as well store plain text and code things to open as needed.
 
Hi. Well, if we are all offering opinions, here's mine. Cheers!
 

Users who are viewing this thread

Back
Top Bottom