• Open Specific Folder

    Author
    Topic
    #477655

    I have a form with a command button with the following code that is used to open a .pdf file named the same as the form ID#.

    Application.FollowHyperlink “C:UsersBryanDocumentsMy ApplicationsAccess ApplicationsMD EventsJournal Docs” & Me.ID & “.pdf”
    Exit Sub

    This has worked fine, but I now need to add additional documents to the same folder and just want to open the folder with the common ID# so I can see all of the associated documents. In other words, I want to open folder 20 from form 20. I’ve tried several different modifications of the code, but get an error every time. I can get Access to open a folder directly, but not one associated with ‘Me.ID’

    Any help greatly appreciated.

    Viewing 0 reply threads
    Author
    Replies
    • #1287008

      Have a look at the attached demo. There is a form with a Browse button. Currently it uses Currentproject.path as the starting folder for the dialog box.
      You will need to modify that to use the number.

      • #1287012

        Thanks John, I tried the demo and liked it (and tucked it away in my “tools” folder). However, I discovered that all I needed to do was change:

        . . . .Journal Docs” & Me.ID & “.pdf” to
        . . . .Journal Docs” & Me.ID

        I actually had thought that I had tried that earlier without success, but I tried again only because I didn’t understand why it wouldn’t. It’s working fine now. Thanks again for your always valued input:clapping:

    Viewing 0 reply threads
    Reply To: Open Specific Folder

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

    Your information: