Results 1 to 4 of 4
  1. #1
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150

    Open a file in a folder


    I know the exact path of a folder in the network by concatenating a couple of fields. Can someone write me the VBA to open the first file it finds in that folder? I say the first file, I presume there might be more than one file, but typically, in any given folder, there's only one file in each folder. I didn't know if it matters.

  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
    This returns the first file found in a folder:

    Code:
    strFileName = Dir("\\ServerName\FolderName\")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150
    Perfect. Thanks, pbaldy.

  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
    Happy to help!
    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. Replies: 1
    Last Post: 03-10-2016, 04:12 PM
  2. Replies: 9
    Last Post: 02-18-2016, 10:38 AM
  3. Replies: 10
    Last Post: 09-09-2015, 03:25 AM
  4. Replies: 3
    Last Post: 02-22-2013, 06:41 AM
  5. Replies: 21
    Last Post: 08-20-2012, 11:59 PM

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