T
Tim McD
I have created code to automaticly create a hyperlink address based on user
input from a click of a command button. The purpose is that we are linking
to pdf file on our server to a field in a table. Each pdf has a unique name
that is associated to the CallSign field in the table. That field is set to
hyperlink. However When I select the command button and to generate the link
I get an "run-time error '7980' THe Hyperlink Address or SubAddress property
is read only for this hyperlink". What am I missing or can I do this some
other way? We have over 500 of these files and I dont want to manually creat
for each one using the link editor.
Dim lCallID, lHyper, lLinkAdd As String
Public Sub GenHyper()
Dim lCall, lLink, lExt As String
Dim dNum As Single
lCall = CallSign
lLink = "License\!Site&LicenseDatabase\"
lExt = ".pdf"
lCallID = lLink + lCall + lExt
lHyper = lCallID
lLinkAdd = lCallID
Lookup.IsHyperlink = True
Lookup.Hyperlink.Address = lLinkAdd
Lookup.Hyperlink.TextToDisplay = lHyper
End Sub
Private Sub Command60_Click()
Lookup.SetFocus
If Lookup.Text = "" Then
Call GenHyper
End If
Lookup.Hyperlink.Address = lLinkAdd
End Sub
input from a click of a command button. The purpose is that we are linking
to pdf file on our server to a field in a table. Each pdf has a unique name
that is associated to the CallSign field in the table. That field is set to
hyperlink. However When I select the command button and to generate the link
I get an "run-time error '7980' THe Hyperlink Address or SubAddress property
is read only for this hyperlink". What am I missing or can I do this some
other way? We have over 500 of these files and I dont want to manually creat
for each one using the link editor.
Dim lCallID, lHyper, lLinkAdd As String
Public Sub GenHyper()
Dim lCall, lLink, lExt As String
Dim dNum As Single
lCall = CallSign
lLink = "License\!Site&LicenseDatabase\"
lExt = ".pdf"
lCallID = lLink + lCall + lExt
lHyper = lCallID
lLinkAdd = lCallID
Lookup.IsHyperlink = True
Lookup.Hyperlink.Address = lLinkAdd
Lookup.Hyperlink.TextToDisplay = lHyper
End Sub
Private Sub Command60_Click()
Lookup.SetFocus
If Lookup.Text = "" Then
Call GenHyper
End If
Lookup.Hyperlink.Address = lLinkAdd
End Sub