• Form PDF Link (2003)

    Author
    Topic
    #429396

    Here is my issue. I have a form in which a user searches for a specific purchase order, and I then display all the pertinent information in a form. I have a directory on my server which we store PDF copies of our purchase orders. The PDF’s are named the same as the purchase order number (i.e. if a user has po number 123456 open in my Access form, the pdf is named 123456.pdf on the server. Is it possible to link to this in my Access form? So whatever PO is open, the link would point to that individual PDF.

    Viewing 1 reply thread
    Author
    Replies
    • #999945

      You can create a hyperlink to the PDF file: take any label, text box, command button, etc. on the form and use the On Current event of the form to set its hyperlink address property:

      Private Sub Form_Current()
      If IsNull(Me.PONum) Then
      ‘ Disable hyperlink
      Me.lblSomething.Hyperlink.Address = “”
      Else
      ‘ Set hyperlink
      Me.lblSomething.Hyperlink.Address = “C:PDF” & Me.PONum & “.pdf”
      End If
      End Sub

      Substitute the correct names and path.

      • #1000146

        Hi Hans,

        It appears the code is working, but the PDF doesn’t stay loaded. It pops up for a second and disappears.

        • #1000160

          That is probably not an Access problem – hyperlinks are handled by the system, not by Access. Can you open PDF files directly?

          • #1000205

            This is my problem as well. But I am running the DB in terminal mode using Citrix. I am searching for an answer and will report back with a solution.

            Thanks,
            Mark

    • #1000064

      You can also use the FollowHyperlink method in the On-Click event of a command button, with code something like:

      Application.FollowHyperLink “server..etc…” & txtPOnum & “.pdf”

    Viewing 1 reply thread
    Reply To: Form PDF Link (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: