Hi. Did you try it this way too?An idea why this is not working
Dim fDialog As Object
Set fDialog = Application.FileDialog(3)
fDialog.InitialView = msoFileDialogViewLargeIcons
I've tried a lot of variations. None seem to work.
Thanks
fDialog.InitialView = 6
I do have one word of caution for you. Sometimes the InitialView behavior is a little finicky and you’re stuck with whatever view you put in the first time. If you restart Excel, your new view should work fine, but, again, you might be stuck with the first InitialView you enter. It’s a weird little quirk.
Private Sub cmdOpenDialog_Click()
Const msoFileDialogFilePicker As Long = 1
Dim objDialog As Object
Set objDialog = Application.FileDialog(msoFileDialogFilePicker)
With objDialog
.InitialView = 6
.AllowMultiSelect = False
.Show
If .SelectedItems.Count = 0 Then
MsgBox "No file selected."
Else
Me.FileNameTextBox.Value = Dir(.SelectedItems(1))
End If
End With
End Sub
Hi. Thanks for the update. Glad to hear you got it sorted out. Good luck with your project.Here's the deal.
The .InitialView Property must be the first in the list. Here is some code from Stack Overflow. I added the .InitialView to several place in the
"With Statement" and finally at the top. And it worked.
https://stackoverflow.com/questions/9476268/filedialog-doesnt-work
I restarted Access after every change. This is important if you don't have the force close code writen, but I was troubleshooting so I was trying a tight control group.
Code:Private Sub cmdOpenDialog_Click() Const msoFileDialogFilePicker As Long = 1 Dim objDialog As Object Set objDialog = Application.FileDialog(msoFileDialogFilePicker) With objDialog .InitialView = 6 .AllowMultiSelect = False .Show If .SelectedItems.Count = 0 Then MsgBox "No file selected." Else Me.FileNameTextBox.Value = Dir(.SelectedItems(1)) End If End With End Sub
Hi. Thanks for the update. Glad to hear you got it sorted out. Good luck with your project.
Hi. Do you mean even if you put it as the first one, like you said earlier? If so, you might try using the Feedback button to let MS know about it.There is a Microsoft Bug.
It doesn't work, and it may not be able to work.
I lied.
These Properties seem to conflict.
Code:With fDialog .InitialView = 6 .InitialFileName = "Z:\OneDrive\Attachments"
It needs a "Change Directory" execution after ".Show".
Sounds like I should be expecting an email from Gina to the MS Team about this. Please let us know how it goes with Win10 and Office 2016. Thanks for the update.Hey DB Guy. I tried all different ways. Then I called my friend Gina Whipp,she said the same things. "They don't play nice together"
I have a laptop with win 10 and Office 2016. I will try it there and let you know.
Sounds like I should be expecting an email from Gina to the MS Team about this. Please let us know how it goes with Win10 and Office 2016. Thanks for the update.
Interesting. I know Access can't do "everything," but it sure can do a whole lot. It's just frustrating when a problem wins. Good luck!I guessing not so much. Her thinking is no one needs it. For everyday Email, I would agree.
But, this is a text message processor, text messages contain a lot of pic attachments. The truth is, I'm moving on past this. User will just have to right click in the dialog box to see the thumb nails.
Thanks for trying to help.