Results 1 to 2 of 2
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I stole this from http://www.access-programmers.co.uk/forums...hp/t-56579.html

    I kept getting an error message when clicking on a textbox containing a hyperlink:
    "Unable to open {your name here}. The hyperlink cannot be followed to the destination"

    Here is my event handler with my old non-working code disabled, the new code working FINE!
    [codebox]Private Sub tbDocuments_Click()
    '''' On Error Resume Next
    '''' Dim retval As Double
    '''' Dim strDestination As String
    '''' strDestination = Me!tbDocuments
    '''' Call strSplitAt(strDestination, "#")
    '''' retval = Shell("winword.exe " & strDestination)
    If IsNull(Me!tbDocuments) Then
    DoCmd.RunCommand acCmdInsertHyperlink
    Else
    ' Do nothing: the hyperlink opens automatically!!!!
    End If
    End Sub[/codebox]

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    I don't know what all your code does, but I find it easier to use this single line of code (strLink is a string variable containing the link):

    Application.FollowHyperLink strLink
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •