P
Pendragon
Access07
I've been using the following code successfully in many applications to open
a browser window for a user to select a file. However, in my current project
I have several different modules where users will be importing and linking to
files and each module should default the file dialog window to a specific
location. Is there a way to set the default location for the file dialog
window which does not reference the database default folder location?
Thanks in advance!
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Me.FileList.ControlSource = ""
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.filters.Clear
.filters.Add "All Files", "*.*"
If .Show = True Then
For Each varFile In .SelectedItems
Me.FileList.AddItem varFile
Me.txtFileToLink.Value = varFile
If IsNull(Me.txtFileToLink) Then
Else
Me.txtFileToLink.SetFocus
End If
Next
Else
End If
End With
Exit Sub
I've been using the following code successfully in many applications to open
a browser window for a user to select a file. However, in my current project
I have several different modules where users will be importing and linking to
files and each module should default the file dialog window to a specific
location. Is there a way to set the default location for the file dialog
window which does not reference the database default folder location?
Thanks in advance!
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Me.FileList.ControlSource = ""
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.filters.Clear
.filters.Add "All Files", "*.*"
If .Show = True Then
For Each varFile In .SelectedItems
Me.FileList.AddItem varFile
Me.txtFileToLink.Value = varFile
If IsNull(Me.txtFileToLink) Then
Else
Me.txtFileToLink.SetFocus
End If
Next
Else
End If
End With
Exit Sub