Access 2010 Pick Path - Filename Options

Hi Experts,

I have the following code for picking a Path / Filename.  It works perfectly.

However it displays the Path Filename Details (Name / Date Modified / Type / Size).  I want it to display only the  Filename/Extension.

What do I need to change to have this occur?

Private Sub BtnFnnnnn_Click()
On Error GoTo STEP_999
'MsgBox "Step 000-Pick Path/File Button Event - F-nn-nnn."
'As Of: 2017/11/29.
'Step Index.
'Step 001-Initialize Common Data.
'Step 100-Select Path And Filename.
'Step 101-Initialize Parameters.
'Step 110-Select Path / Filename.
'Step 119-Clean-up.
'Step 900-Shutdown.
'Step 990-Exit Event.
'Step 999-Form Error Handler Code.

'Parameters.
' Parameter               Description
' .AllowMultiSelect       False = 1 File.  True = Multiple Files.
' .Title Option.          String of Dialog Box Title to be displayed.
' .ButtonName.            String of Dialog Box Selection Button Title to be displayed.
' .Filters.Add            Commented out = No Filters.  Not Commented out, specify Filter Name / string.  e.g. "Documents", "*.doc; *.txt", 1
' .Filters.Add            Add addtional lines for addtional File Types.  Last entry displays first in Dialog Box.
' .InitFileName           Commented out = Last selected.  Specified = Path Starting point.  e.g. .InitialFileName = "M:\"
'  WrkSelectedItem001     Contains the Path / Filename selected.

'Step 001-Initialize Common Data.
Dim FileDialog001 As Office.FileDialog
Dim WrkPath001 As String
Dim WrkPathFilename001 As String
Dim WrkSelectedItem001 As Variant
'Step 100-Select Path And Filename.
'Step 101-Initialize Parameters.
Set FileDialog001 = Application.FileDialog(msoFileDialogFilePicker)
WrkPath001 = Left(Me.FnnnnnPathFilename, InStrRev(Me.FnnnnnPathFilename, "\") - 1) & "\"
'Step 110-Select Path / Filename.
With FileDialog001
   .AllowMultiSelect = False
   .title = "Browse For Import File"
   .ButtonName = "Select Import Path/Filename."
   .Filters.Clear  'Clear File Type Filters if any.
   '.Filters.Add "Documents", "*.txt", 1
   .Filters.Add "Documents", "*.xlsm;*.xls;*.xlsx", 1
   .InitialView = msoFileDialogViewDetails
   .InitialFileName = WrkPath001  'Must be a Path.  i.e. Not Path & Filename.
   If .Show = -1 Then
      For Each WrkSelectedItem001 In .SelectedItems
         WrkPathFilename001 = CStr(WrkSelectedItem001)
      Next WrkSelectedItem001
   Else
      WrkPathFilename001 = Me.FnnnnnPathFilename
   End If
End With
Me.FnnnnnPathFilename = WrkPathFilename001
'Step 119-Clean-up.
Set FileDialog001 = Nothing
STEP_900:
'Step 900-Shutdown.
STEP_990:
'Step 990-Exit Event.
Exit Sub
STEP_999:
'Step 999-Form Error Handler Code.
Dim M00000_999 As Form
Set M00000_999 = [Forms]![M-00-000 - Scout Admin System - Main Menu]
Dim DebugErrMsgOption999 As String
'DebugErrMsgOption999 = "Yes" 'Un-Comment for use.
If DebugErrMsgOption999 = "Yes" Then
   MsgBox Err.DESCRIPTION & " (" & Err.Number & ")"
   Resume STEP_990
Else
   Resume STEP_990
End If
End Sub

Open in new window

Thanks,
Bob C.
Bob CollisonSystem ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Try changing:

  .InitialView = msoFileDialogViewDetails

to:

  .InitialView = msoFileDialogViewList


»bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

I will use Code Blocks in the future.

Your solution does only display the Filename/Extension however the Dialog Box Heading displays the Name / Date Modified / Type / Size.

Thanks,
Bob C.
0
Bill PrewCommented:
What version of Windows, and Word?

Can you paste a screen capture of that?


»bp
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

I am attaching the screen capture along with the code updated with your suggestion.

Thanks,
Bob C.
msoFileDialogViewList-option.docx
0
Bill PrewCommented:
What version of Windows and Word?
0
Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

Sorry I forgot them.
- Windows 7 Pro SP1
- MS Office 2010 (Access, Word, Excel, etc.)
Thanks,
Bob C.
0
Bill PrewCommented:
Okay, maybe that's just the way it looked "back then", I don't have that config to confirm on here though.

If you open Windows File Explorer, and change the view to List, do you see the column headings there too?


»bp
0
Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

In my Windows Explored List doesn't have any Column Headings displayed.  Details displays the Column Headings.

Thanks,
Bob C.
0
Bill PrewCommented:
Not sure I know how to solve that...

Once you get the file picker dialog box up, if you change the view there with the icon to the top right-ish, to something other than details, do the headers go away?


»bp
0
Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

In the Dialog Box when I select the 'Options' the 'List' Option is highlighted but the Details Column Headings are displayed.

Regardless of which Option I chose the Details Column Headings stay displayed.

In Windows Explorer all of the Options display correctly.  i.e.  The only one that displays the Column Headings is the Details Option.

I have another code set that also does this and it also always displays the Details Columns so maybe this is Microsoft Bug.

Thanks,
Bob C.
0
Bill PrewCommented:
Yes, sounds like perhaps that File Picker Dialog has that "feature" in the version you are running.  You might have to live with it...


»bp
0
Bob CollisonSystem ArchitectAuthor Commented:
Hi Bill,

I checked on the version that is in production (different PC but Windows 7 SP1 / Office 2010 including Access 2010) and it works perfectly so it does appear that the PC with the issue has something different.

At this point I don't think that we are going to get any further so I will close the Ticket.

Thanks for all your assistance.  You did answer the original question.

Thanks,
bob C.
0
Bill PrewCommented:
Welcome, glad I was able to help.


»bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.