Can anyone tell me why this code is crashing in a Runtime enviroment
This is code from MS NorthWind
Sub getFileName()
' Displays the Office File Open dialog to choose a file name
' for the current logo. If the user selects a file
' display it in the image control.
Dim FileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Logo Picture"
.Filters.Add "All Files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "Bitmaps", "*.bmp"
.FilterIndex = 3
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show
If (result <> 0) Then
FileName = Trim(.SelectedItems.Item(1))
Me![ImagePath].Visible = True
Me![ImagePath].SetFocus
Me![ImagePath].Text = FileName
Me![CompanyName].SetFocus
Me![ImagePath].Visible = False
End If
End With
End Sub