S
Sash
I have the following that I want call from a form. How do I pass the
filename back to the form?
Public Function Frame50_File()
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Import File"
.Filters.Clear
.Filters.Add "Text", "*.txt"
.Filters.Add "All Files", "*.*"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = "\u:interfaces/import/"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Else
MsgBox "No file selected"
fileName = ""
Forms!MainForm.[Frame50] = Null
End If
If fileName = "" Then Exit Function
End With
End Function
filename back to the form?
Public Function Frame50_File()
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Import File"
.Filters.Clear
.Filters.Add "Text", "*.txt"
.Filters.Add "All Files", "*.*"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = "\u:interfaces/import/"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Else
MsgBox "No file selected"
fileName = ""
Forms!MainForm.[Frame50] = Null
End If
If fileName = "" Then Exit Function
End With
End Function