Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    5

    Unanswered: Open hyperlink from query field

    I am trying to write VBA code to open a hyperlink, from a field in a query, using the default application (Adobe Acrobat in this case). The code below is what I have so far, but do not know how to add to it to have it open in Acrobat. Currently, it only displays the hyperlink in datasheet view.

    rivate Sub Command59_Click()
    Dim qryLithLogLinks As Hyperlink

    'MsgBox "Click the hyperlink in the following datasheet", vbOKOnly, "The Next Step"

    DoCmd.OpenQuery ("qryLithLogLinks")

    Application.FollowHyperlink qryLithLogLinks, , True


    End Sub

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Can you not just use the button on the form?

    If not open a continuous form with buttons on each row;

    Have the hyperlink in the query behind the form (a or b) and put it as an invisible control.

    During the cmdOpenHyperlink_Click
    '(maybe rename your button to something more descriptive)

    Me.cmdOpenHyperlink.hyperlinkaddress = me.YourHyperlinkField
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    May 2009
    Posts
    5
    I've got this now (below), but it returns a Run-time error '7971', the database cannot follow the hyperlink to...

    Private Sub Command59_Click()

    Dim strPath As String

    DoCmd.OpenQuery ("qryLithLogLinks")

    strPath = DLookup("Lith_Logs", "qryLithLogLinks")

    Application.FollowHyperlink strPath, , True

    End Sub

Posting Permissions

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