i have a table where the user enters, along with a few other items, a hyperlink to a related file (on the company server); (typically a *.pdf or *.jpg)
On an associated form, rather than display the full path of the hyperlink, i provide a textbox with only the actual file name.
Code:
vFileName = Trim(.SelectedItems.Item(1)) 'contains the hyperlink path
strFileName = Mid(filename, InStrRev(vFileName, "\", -1, vbTextCompare) + 1)
I need to find a way to allow the user to open the hyperlink through this textbox (with strFileName as its ControlSource.
(as a check, I added a textbox that does have the hyperlink field as its source, and clicking on that control does open the link )
using this code, i instead get: ERROR7971
Code:
Private Sub txtlinktoContractDoc_DblClick(Cancel As Integer)
On Error GoTo Error_linktoContractDoc
Dim strHyperLink As String
strHyperLink = DLookup("linktoContractDoc", "tbeProjectInfo_ContractDocs", "ContractID like '" & Me.txtContractID & "'")
Application.FollowHyperlink strHyperLink, , True
Error_linktoContractDoc:
MsgBox Err & ": " & Err.Description
End Sub
any thoughts and/or suggestion will be greatly appreciated in advance,
m.