Skip to main content

AccessTr.neT


Excel Vba İle Userform Üzerinden Kayıt Silme Hakkında.

Oğuz Türkyılmaz
Oğuz Türkyılmaz
27
2307

Excel Vba İle Userform Üzerinden Kayıt Silme Hakkında.

#20
kayıt silince combodan da o değeri silen kod eklenmiştir
ComboBox_FirmaUnvani.RemoveItem (Me.ComboBox_FirmaUnvani.ListIndex) '<== combodan değer silme
Private Sub btn_KayitSil_Click()
If Len(TextBox_ID & "") = 0 Then Exit Sub
If MsgBox("Veriler Silinecek, Emin misiniz...?", vbExclamation + vbYesNo, "Firma Tanımlama Formu") = vbNo Then Exit Sub

    With ThisWorkbook.Worksheets("Ana_Sayfa")
            KytSil (TextBox_ID)
            ComboBox_FirmaUnvani.RemoveItem (Me.ComboBox_FirmaUnvani.ListIndex) '<== combodan değer silme
            Call temizle
            TextBox_Tarih = Format(Date, "dd.mm.yyyy")
   
    End With
   
    TextBox_Tarih.SetFocus
       
    With TextBox_Tarih
                .SelStart = 0
                .SelLength = .TextLength
            End With
           
    btn_KayitEkle.Enabled = True
    
End Sub
Modüle eklenen kayıt silme kodu
Sub KytSil(ByVal IDBul As String)

Dim tbl As ListObject
Dim Sonuc As Range

With ThisWorkbook.Worksheets("ana_sayfa")
 
  Set tbl = .ListObjects("Tablo1")

'1. sütunda veri arama
  On Error Resume Next
  Set Sonuc = tbl.DataBodyRange.Columns(1).Find(IDBul, LookAt:=xlWhole)
  On Error GoTo 0

'bulunan verini silinmesi
        .Unprotect "171717"
            If Not Sonuc Is Nothing Then
              xTblBul = tbl.ListRows(Sonuc.row - tbl.HeaderRowRange.row).Index
              tbl.ListRows(xTblBul).Delete
            End If
        .Protect "171717"
End With
End Sub
.rar WINPERAX DENEMELER_hy8.rar (Dosya Boyutu: 190,24 KB | İndirme Sayısı: 1)
Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Re: Excel Vba İle Userform Üzerinden Kayıt Silme Hakkında. - Yazar: berduş - 26/04/2021, 02:43
Task