Sub getFileName()
' Displays the Office File Open dialog to choose a file name
' for the current employee record. If the user selects a file
' display it in the image control.
'Me.resim = Null
Dim fileName As String
Dim Result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Dosya Seç"
.Filters.Add "Bütün dosya türleri", "*.*"
.Filters.Add "WORD", "*.docx"
'.Filters.Add "word_eski", "*.doc"
'.Filters.Add "text", "*.txt"
'.Filters.Add "excel_yeni", "*.xlsx"
'.Filters.Add "excel_eski", "*.xls"
'.Filters.Add "Gif", "*.gif"
'.FilterIndex = 1
'.AllowMultiSelect = False
.InitialFileName = "c:\"
Result = .Show
If (Result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me.dosya_konumu.SetFocus
Me.dosya_konumu = Left(fileName, InStrRev(fileName, "\"))
'' Me.dosya_konumu = Dir(fileName)
' Me![baski-desen-no].SetFocus
' Me![resim].Visible = False
'Call resim_AfterUpdate
End If
End With
End Sub
Kodu aşağıdaki ile değiştirerek deneyiniz. Ayrıca ' ile iptal edilen alanlara işlem yapılmadı.