vhung
Member
- Local time
- Today, 12:40
- Joined
- Jul 8, 2020
- Messages
- 235
Thanks, for the tips, codes, ideas, it helps a lot to extend the use of MS access in the unique way as one creativeness reach the peak.
Dim fd As Object
Set fd = Application.FileDialog(3)
With fd
.Title = strWindowTitle
.Filters.Clear
If Forms![Form: Tab Page]![TabName] = "AllPage" Then
.AllowMultiSelect = True
ElseIf Forms![Form: Tab Page]![TabName] = "PDF" Then
.Filters.Add "PDF", "*.pdf;*.html", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Excel" Then
.Filters.Add "Excel Workbooks", "*.xls;*.xlsx;*.xlsm", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Image" Then
.Filters.Add "Image", "*.png;*.jpeg;*.jpg", 1
ElseIf Forms![Form: Tab Page]![TabName] = "PowerPoint" Then
.Filters.Add "Powerpoint", "*.ppt;*.pptx;*.pps", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Word" Then
.Filters.Add "Word", "*.docx;*.docm;*.doc;*.txt", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Outlook" Then
.Filters.Add "Outlook", "*.ics;*.xml;*.msg;*.vcf;*.srs;*.exe;*.pst", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Access" Then
.Filters.Add "Access", "*.Accdb;*.Accde;*.mdb", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Folder" Then
DriveAddressCombo.setfocus
End If
If .Show = -1 Then
FilePicker = (.SelectedItems(1))
Else
FilePicker = vbNullString
End If
End With
Set fd = Nothing
Dim fd As Object
Set fd = Application.FileDialog(3)
With fd
.Title = strWindowTitle
.Filters.Clear
If Forms![Form: Tab Page]![TabName] = "AllPage" Then
.AllowMultiSelect = True
ElseIf Forms![Form: Tab Page]![TabName] = "PDF" Then
.Filters.Add "PDF", "*.pdf;*.html", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Excel" Then
.Filters.Add "Excel Workbooks", "*.xls;*.xlsx;*.xlsm", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Image" Then
.Filters.Add "Image", "*.png;*.jpeg;*.jpg", 1
ElseIf Forms![Form: Tab Page]![TabName] = "PowerPoint" Then
.Filters.Add "Powerpoint", "*.ppt;*.pptx;*.pps", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Word" Then
.Filters.Add "Word", "*.docx;*.docm;*.doc;*.txt", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Outlook" Then
.Filters.Add "Outlook", "*.ics;*.xml;*.msg;*.vcf;*.srs;*.exe;*.pst", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Access" Then
.Filters.Add "Access", "*.Accdb;*.Accde;*.mdb", 1
ElseIf Forms![Form: Tab Page]![TabName] = "Folder" Then
DriveAddressCombo.setfocus
End If
If .Show = -1 Then
FilePicker = (.SelectedItems(1))
Else
FilePicker = vbNullString
End If
End With
Set fd = Nothing
Attachments
Last edited: