FileDialog default to Application.CurrentProject.Path

  • Thread starter Thread starter hwdperk
  • Start date Start date
H

hwdperk

I have an MS Access database which has a button with the following codebehind:

Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogFilePicker)
With dlgOpen
.Filters.Clear
.Filters.Add "All Files", "*.*"
.Filters.Add "Adobe PDF", "*.pdf"
.Filters.Add "Word Documents", "*.doc"
.Filters.Add "RTF Documents", "*.rtf"
.AllowMultiSelect = False
.title = "Please select File"
.InitialFileName = Application.CurrentProject.Path
.InitialView = msoFileDialogViewList

If .Show = True Then
...
...

If I click on the button, the file dialog opens as expected in the root of
the application. When another user clicks on the same button, they get a
message indicating that the folder location is not available - and the error
suggests that they are interpreting the Application.CurrentProject.Path as
being within the users My Documents folder. The only difference between us
is that we map to the location of the .mdb file differently - but I'm
assuming the Application.CurrentProject.Path should return the path as I (or
anyone else) is mapped to it.
 
Check the other persons permissions to the folder. Could be that they have
permission to the application in the folder but no permission to
view/select/open other files in the folder.

Easy way to do this from their computer is to navigate to the folder with
windows explorer and test whether they can see the file list and whether they
can open any other files in the folder.
 
I have confirmed the user has fill rights - list, read, write, update, delete
- she would appear to have full permissions to the folder, content and
sub-folders.
 
Back
Top