Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Find a folder using UNC path
Rob Whitney 
   
3 years ago
I have an Access app, in which the user needs to select a folder. There are a number of shares across 2 servers, so I need to use the UNC path. But using the Windows File Selector dialog from VBA, I can't get it to use the UNC path (local folders only).
Is there a solution?
Alex Hedley  @Reply  
           
3 years ago
Is the path mapped for the user already?

Could run a net use PATH command first
Kevin Yip  @Reply  
     
3 years ago
Hi Rob, the Application.FileDialog property should give you a dialog box that lets you select network paths.  Sample code:

Sub PickFolder()
    Dim fd, fnc, fn
    Set fd = Application.FileDialog(4)
    fd.Title = "Pick a folder"
    fd.InitialFileName = ""
    fd.AllowMultiSelect = False
    fd.show
    fnc = fd.SelectedItems.Count
    If fnc > 0 Then MsgBox "Folder selected:" & fd.SelectedItems(1)
End Sub

Microsoft's documentation is here:    https://learn.microsoft.com/en-us/office/vba/api/access.application.filedialog

FileDialog(4) gives you the folder picker, and (3) the file picker.  The line "fd.show" will wait till the user makes a selection before progressing.  A selection count (zero if nothing selected), and the full path of the selected file or folder, if any, will be returned.  If the file/folder resides in a network share, the full path will be in UNC format:  \\mypc\mysharedfolder
Richard Rost  @Reply  
          
3 years ago
Yeah, using Kevin's example, even if I pick my server drive, which is mapped to Z:\Database, it still returns \\SERVER\Database

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/9/2026 1:12:12 AM. PLT: 1s