By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,332 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,332 IT Pros & Developers. It's quick & easy.

One button, multiple hyperlinks

P: 32
I have many Visio diagrams. There is 1 Diagram per SITE.

I have a LISTBOX1 which lists all sites.
After selecting a site in listbox1, I would like to have a BUTTON1 that opens up the appropriatte Hyperlink to a visio diagram for the particular site on the listbox.

LISTBOX1 gets data from SITE table (SITEID is the primary key)
Hyperlinks are:
\\S01cspr01\corpshare\MDF\site0.vsd
\\S01cspr01\corpshare\MDF\site1.vsd
\\S01cspr01\corpshare\MDF\site2.vsd
\\S01cspr01\corpshare\MDF\site3.vsd
\\S01cspr01\corpshare\MDF\site4.vsd

Private Sub Button1_Click()
On Error GoTo Err_Button1_Click




Exit_Button1_Click:
Exit Sub

Err_Button1_Click:
MsgBox Err.Description
Resume Exit_Button1_Click

End Sub

Thanks for your help.
Jun 4 '07 #1
Share this Question
Share on Google+
7 Replies

JConsulting
Expert 100+
P: 603
I have many Visio diagrams. There is 1 Diagram per SITE.

I have a LISTBOX1 which lists all sites.
After selecting a site in listbox1, I would like to have a BUTTON1 that opens up the appropriatte Hyperlink to a visio diagram for the particular site on the listbox.

LISTBOX1 gets data from SITE table (SITEID is the primary key)
Hyperlinks are:
\\S01cspr01\corpshare\MDF\site0.vsd
\\S01cspr01\corpshare\MDF\site1.vsd
\\S01cspr01\corpshare\MDF\site2.vsd
\\S01cspr01\corpshare\MDF\site3.vsd
\\S01cspr01\corpshare\MDF\site4.vsd

Private Sub Button1_Click()
On Error GoTo Err_Button1_Click




Exit_Button1_Click:
Exit Sub

Err_Button1_Click:
MsgBox Err.Description
Resume Exit_Button1_Click

End Sub

Thanks for your help.
you can use the followhyperlink command as your onClick event

followhyperlink me.mylistbox.column(x)

that is, if this "\\S01cspr01\corpshare\MDF\site0.vsd" is what's in the column
Jun 4 '07 #2

P: 32
The Listbox value is used for other functions on the same form, so I cannot dedicate its functions to only Hyperlinks.

Thanks for the advice.
Jun 4 '07 #3

Rabbit
Expert Mod 10K+
P: 12,441
The Listbox value is used for other functions on the same form, so I cannot dedicate its functions to only Hyperlinks.

Thanks for the advice.
I'm just confused by your response. There's no mention of dedicating the listbox's function to hyperlinks in Jconsulting's solution nor is there a need to.
Jun 4 '07 #4

JConsulting
Expert 100+
P: 603
The Listbox value is used for other functions on the same form, so I cannot dedicate its functions to only Hyperlinks.

Thanks for the advice.
so the value IS the \\path\file...etc ?
Jun 4 '07 #5

P: 32
I got it working, Thanks

Private Sub ViewFloorPlan_Click()
On Error GoTo Err_ViewFloorPlan_Click

Dim stAppName As String
If Me![List0] = "250" Then
FollowHyperlink ("\\S01cspr01\corpshare\MDF\Carteret\Verizon_Cage. vsd")
ElseIf Me![List0] = "31" Then
FollowHyperlink ("\\S01cspr01\corpshare\MDF\1633 Broadway\48Floor\MDF Floor Layout.vsd")
ElseIf Me![List0] = "32" Then
FollowHyperlink ("\\S01cspr01\corpshare\MDF\New Rochelle\NR_Layout.vsd")
End If

Exit_ViewFloorPlan_Click:
Exit Sub

Err_ViewFloorPlan_Click:
MsgBox Err.Description
Resume Exit_ViewFloorPlan_Click

End Sub
Jun 4 '07 #6

Rabbit
Expert Mod 10K+
P: 12,441
It's be better for you to just include an extra invisible column in the listbox that holds the link information.
Jun 4 '07 #7

P: 32
Not sure how to do that, but will try.
Jun 4 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.