Results 1 to 4 of 4
  1. #1
    element32d is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    24

    Accessing PDF files after dropdown menu selection

    Hello, I'm relative new to Access but here's what I'm trying to do:

    There is a field already that has a dropdown menu that a user selects from and there is a PDF on a fileserver that is associated with every selection possible.

    What I want is the PDF file to open automatically (or maybe a button to appear) once the user makes a selection from that dropdown menu.

    So far what I have is a hyperlink field and a couple test links and a created button on the form with a sketchy macro I came up with (an if statement saying if the selection made = the selection field, look at the hyperlink and open it).



    Hopefully you guys can help me, if this wasn't clear enough let me know.

    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If the combo contains the full path to the file, you should be able to use FollowHyperlink in the after update event of the combo. More info in VBA help on FollowHyperlink.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    element32d is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    24
    Quote Originally Posted by pbaldy View Post
    If the combo contains the full path to the file, you should be able to use FollowHyperlink in the after update event of the combo. More info in VBA help on FollowHyperlink.
    Hmmmmm, okay. I've thought about it more and researched more and basically now all I need is this new button to select from a field of hyperlinks associated with each respective "part number'. Say I have these two fields, and the user just selected the part number from a drop down menu. Now I'd like to know the code so this "get pdf" button can associate with that dropdown selection and popup the file once the user clicks the button.

    so the code should start like application.followhyperlink ... and then where does the field full of hyperlinks go (lets call this field 'linkstopdf')?

    Edit: Here's the event procedure code:

    Code:
    Private Sub Command47_Click()
    
    Dim strAcPath As String
    Dim strFName As String
    
    
    
    
    If IsNull(Me.[Part #]) = True Then
        MsgBox "You must select a PDF from the list", vbCritical, "Selection Error"
        [Part #].SetFocus
    Else
        strFName = Me.[Part #].Column(33)
        strAcPath = "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"
        Call Shell(strAcPath & " " & [strFName], vbMaximizedFocus)
    End If
    
    
    End Sub
    I want to open the pdf from the user selected dropdown of the part number. The pdf hyperlinks are stored in a separate field in a table.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Like

    Application.FollowHyperlink Me.ComboName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Accessing linked files
    By ashok in forum Access
    Replies: 1
    Last Post: 06-28-2012, 07:55 PM
  2. Replies: 3
    Last Post: 08-19-2011, 09:25 AM
  3. Can I use dropdown menu selections in a sum?
    By REAPER_110 in forum Forms
    Replies: 1
    Last Post: 05-02-2011, 04:05 PM
  4. Form dropdown selection
    By piper in forum Forms
    Replies: 2
    Last Post: 04-16-2011, 09:34 AM
  5. Replies: 2
    Last Post: 08-03-2010, 10:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums