21/12/2010, 16:11
Selam
Bir çok uygulamada kullandığım kodlar hata verdi
referanslar da tamam sorun nerde yardımcı olusanız sevinirim
User-Defined Typ not defined
Dim dlg As FileDialog
Dim si As Variant
Dim uzan As Integer
Dim FileName, yeniyol As String
Dim vrtSelectedItem As Variant
If IsNull(Adres_ID) Then: MsgBox "Kayıtlı Veri Yok !!! " & "Kayıtı Veri Olmadan Resim Ekleyemezsiniz": Exit Sub
If Len(Dir(Application.CurrentProject.Path & "\CariResim", vbDirectory)) = 0 Then
' MkDir Application.CurrentProject.Path & "\CariResim"
End If
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.AllowMultiSelect = False
.ButtonName = "Select Pic"
.Filters.Add "Pictures", "*.gif; *.jpg; *.jpeg; *.bmp"
.Filters.Add "All", "*.*"
.FilterIndex = 0
.InitialFileName = Environ("UserProfile") & "\My Documents\*.bmp;*.gif;*.jpg;*"
'.InitialFileName = Application.CurrentProject.Path & "\CariResim"
.InitialView = msoFileDialogViewThumbnail
.Title = "Select picture..."
If .Show = True Then
For Each vrtSelectedItem In .SelectedItems
FileName = vrtSelectedItem
uzan = InStr(StrReverse(FileName), "\")
yeniyol = Application.CurrentProject.Path & "\CariResim" & Right(FileName, uzan)
Debug.Print yeniyol & "----- " & FileName
If FileName = yeniyol Then
GoTo ylcn
End If
Next vrtSelectedItem
FileCopy FileName, yeniyol
ylcn:
Me.picImage1 = yeniyol
Me.Image145.Picture = picImage
Me.Etiket133.Visible = False
Me.Resim1.Visible = False
End If
End With
Bir çok uygulamada kullandığım kodlar hata verdi
referanslar da tamam sorun nerde yardımcı olusanız sevinirim
User-Defined Typ not defined
Dim dlg As FileDialog
Dim si As Variant
Dim uzan As Integer
Dim FileName, yeniyol As String
Dim vrtSelectedItem As Variant
If IsNull(Adres_ID) Then: MsgBox "Kayıtlı Veri Yok !!! " & "Kayıtı Veri Olmadan Resim Ekleyemezsiniz": Exit Sub
If Len(Dir(Application.CurrentProject.Path & "\CariResim", vbDirectory)) = 0 Then
' MkDir Application.CurrentProject.Path & "\CariResim"
End If
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.AllowMultiSelect = False
.ButtonName = "Select Pic"
.Filters.Add "Pictures", "*.gif; *.jpg; *.jpeg; *.bmp"
.Filters.Add "All", "*.*"
.FilterIndex = 0
.InitialFileName = Environ("UserProfile") & "\My Documents\*.bmp;*.gif;*.jpg;*"
'.InitialFileName = Application.CurrentProject.Path & "\CariResim"
.InitialView = msoFileDialogViewThumbnail
.Title = "Select picture..."
If .Show = True Then
For Each vrtSelectedItem In .SelectedItems
FileName = vrtSelectedItem
uzan = InStr(StrReverse(FileName), "\")
yeniyol = Application.CurrentProject.Path & "\CariResim" & Right(FileName, uzan)
Debug.Print yeniyol & "----- " & FileName
If FileName = yeniyol Then
GoTo ylcn
End If
Next vrtSelectedItem
FileCopy FileName, yeniyol
ylcn:
Me.picImage1 = yeniyol
Me.Image145.Picture = picImage
Me.Etiket133.Visible = False
Me.Resim1.Visible = False
End If
End With