Results 1 to 3 of 3
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Open Specific Folder

    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:\Users\Bryan\Documents\My Applications\Access Applications\MD Events\Journal 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.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    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.
    Attached Files Attached Files
    Regards
    John



  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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
    Last edited by bfxtrfcmgr; 2011-07-07 at 19:37.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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