Skip to main content

AccessTr.neT


Formdan Evrak Seçip Kaydetmek

Formdan Evrak Seçip Kaydetmek

#13
evrak seçme butonunun kodu
bu kod ile eklenecek dosyanın konumu metin kutusuna yazılır
Dim fDialog As FileDialog
Dim varFile As Variant

Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.InitialFileName = CurrentProject.Path
.Title = "Dosya seç"
.Filters.Clear
.Filters.Add "PDF-dosyaları", "*.PDF"
If .Show = True Then
txtEvrak_Adres = fDialog.SelectedItems(1) ' "#" & fDialog.SelectedItems(1) & "#"
End If
End With
kaydet butonunun kodu
eklenen satırlar ile seçilen dosya dosyalar klasörüne ID adıyla kopyalanır
eklenen satırlar:
Kynk = txtEvrak_Adres '<--Eklenen
Hdf = CurrentProject.Path & "\Dosyalar\" '<--Eklenen

FileCopy Kynk, Hdf & rs(0) & ".pdf" '<--Eklenen
txtEvrak_Adres = "#" & "Dosyalar\" & rs(0) & ".pdf" & "#" '<--Eklenen
Private Sub BtnKaydet_Click()
Dim rs As New ADODB.Recordset
Kynk = txtEvrak_Adres '<--Eklenen
Hdf = CurrentProject.Path & "\Dosyalar\" '<--Eklenen
rs.Open "TblMucbirTutanaklari", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.AddNew

FileCopy Kynk, Hdf & rs(0) & ".pdf" '<--Eklenen
txtEvrak_Adres = "#" & "Dosyalar\" & rs(0) & ".pdf" & "#" '<--Eklenen
rs("Kesinti_No") = txtKesinti_No
rs("Is_Emri_No") = txtIs_Emri_No
rs("Is_Emri_No2") = txtIs_Emri_No2
rs("Il") = txtIl
rs("Ilce") = txtIlce
rs("Sebeke_Unsuru") = txtSebeke_Unsuru
rs("Kesinti_Nedeni") = txtKesinti_Nedeni
rs("Kaynaga_Gore") = txtKaynaga_Gore
rs("Sureye_Gore") = txtSureye_Gore
rs("Sebebe_Gore") = txtSebebe_Gore
rs("Bildirime_Gore") = txtBildirime_Gore
rs("Baslama_Tarihi") = txtBaslama_Tarihi
rs("Bitis_Tarihi") = txtBitis_Tarihi
rs("Aciklama") = txtAciklama
rs("Evrak_Adresi") = txtEvrak_Adres

rs.Update
rs.Close

Me.LstTutanak.Requery

MsgBox "Kayıt edildi"

Call TutanakTemizle

End Sub
kaydet butonuna 4 satır kod ekledim benzer kodlar güncelleme butonuna da eklenmeli
ama güncelleme butonuna da eklenmeli ama güncellemede 2 sorun var
1 - dosya adı ID alanına göre belirlendiği için aynı adda 2 dosya sorun çıkarır aynı klasörde aynı adda 2 dosya olamaz
2 - eğer güncelleme dosya değişikliğinden kaynaklanmıyorsa ek önlemler alınmalı
Cevapla
#14
Teşekkürler hocam

elinize emeğinize sağlık
Cevapla
#15
rica ederim
iyi çalışmalar
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task