What I am trying to do is see what folder the user selects using the FileDialogPicker. I then want to store that value in a table so the next time they open the DB it 'remembers' the last location that they selected. I know if you remove the .InitialFileName it remembers that location per session, but I want to store it so that the next time they open the DB it goes right back to where they were.
Do I need to use a msoFileDialogFolderPicker in conjuction with this? Thanks for any tips.
Dim strSelectedFile As String
Set fdg = Application.FileDialog(msoFileDialogFilePicker)
' fdg.InitialFileName = "c:\"
.Filters.Add "Excel Files", "*.xls"
.Filters.Add "Excel 2007", "*.xlsx"
' .AllowMultiSelect = True
.InitialView = msoFileDialogViewDetails
If .Show = -1 Then
DoCmd.RunSQL ("Delete * from DynamicReportTest")
For Each vrtSelectedItem In .SelectedItems
strSelectedFile = vrtSelectedItem
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "DynamicReportTest", strSelectedFile, False, , False
MsgBox "No File Selected"