Open a site clicking on ListBox

Shady Baby

New member
Local time
Today, 08:03
Joined
Jun 24, 2008
Messages
6
RESOLVED
Code:
Private Sub ListBox_Click()
Link = Replace(Replace(Me.ListBox.Column(2), "[URL]file://///[/URL]", "\\"), "/", "\")
Application.FollowHyperlink Link, , True
End Sub

Since I didn't have IIS running on the central server, I have to replace the "file://///" to "\\" and all the "/" to "\"
_____________________________________________________________________________________________

Hello,
I have a listbox, and I wanted to know how do I do to open a site when I click on a row.



So, If I clicked on the row which says Rhapsody, I would open the site "www.google.com", if I clicked on redead, I would open "www.msn.com" ...

Thanks
 
Last edited:
Some controls have a HyperlinkAddress property. The click event handler of your listbox can assign a value to the HyplerlinkAddress property of a hidden contol and then you can run the Follow method of that control's Hyperlink property.

Code:
private sub yourlist_click()
[COLOR="SeaGreen"]  'cmdHiddenLink is a command button with it's visible property set to false
  'at design time[/COLOR]  
  me.cmdHiddenLink.hyperlinkaddress = "http://" & <your URL here>
  me.cmdHiddenLink.hyperlink.follow
end sub
 
But in my case I have more than a hundred registrations, which means lots of different links, which means I would need hundreds of Command Buttons...

But anyway, since I have the links on the database I could just as soon I selected a row, atribute its link to a textbox and follow it...but then I still have the problem which I posted on the next post.

Note: Only after post it I edited this one
 
Last edited:
RESOLVED

Code:
Private Sub ListBox_Click()
Link = Replace(Replace(Me.ListBox.Column(2), "[URL]file://///[/URL]", "\\"), "/", "\")
Application.FollowHyperlink Link, , True
End Sub

Since I didn't have IIS running on the central server, I have to replace the "file://///" to "\\" and all the "/" to "\"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom