Skip to main content

AccessTr.neT


Excel Userformda Mükerrer Kayıt Engelleme

Oğuz Türkyılmaz
Oğuz Türkyılmaz
6
957

Excel Userformda Mükerrer Kayıt Engelleme

Çözüldü #1
Herkese sağlıklı günler.
EXCEL User Formda Mükerrer kayıt yapıldığında uyarsın, istendiği takdirde kayıt gerçekleşsin diye yazdığım kod mükerrer kaydı bana bildiriyor fakat kayıt yap dediğimde kayıt mükerrer olsun olmasın kaydı ilk boş satıra değil de 2 ayrı satıra boşluk bırakarak yapıyor. Bu hatayı nasıl düzeltebilirim. Sayfa koruma parolası 171717 Kaldırmayı unutmuşum özür dilerim.

[Resim: do.php?img=10800]




Private Sub btn_KayitEkle_Click()

If MsgBox("Girdiginiz veriler kaydedilecektir, Emin misiniz...?", vbExclamation + vbYesNo, "Firma Tanımlama Formu") = vbNo Then Exit Sub

Dim Firma, YeniFirma

Firma = TextBox_FirmaAdi.Value

YeniFirma = IIf(Application.CountIf(Columns(1), Firma) > 0, 1, 0)

If YeniFirma > 0 And TextBox_FirmaAdi.Value <> "" Then

If MsgBox("Aynı Adla Yapılmış Firma Kaydı Bulundu...Kayıt Yapılsın mı...?", vbExclamation + vbYesNo, "Firma Tanımlama Formu") = vbNo Then Exit Sub

Else

Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = Firma

End If


' Application.ScreenUpdating = False

    With ThisWorkbook.Worksheets("Ana_Sayfa")
    '    .Unprotect sifre
        SonSatir = WorksheetFunction.CountA(.Range("A:A")) + 1
       
        .Cells(SonSatir, 1) = WorksheetFunction.Max(.Range("A2:A" & Rows.Count)) + 1
        .Cells(SonSatir, 2) = TextBox_FirmaAdi.Value
        .Cells(SonSatir, 3) = TextBox_FirmaUnvani.Value
        .Cells(SonSatir, 4) = TextBox_YetkiliKisi.Value
        .Cells(SonSatir, 5) = TextBox_Telefon.Value
        .Cells(SonSatir, 6) = TextBox_Gsm.Value
        .Cells(SonSatir, 7) = TextBox_Email.Value
        .Cells(SonSatir, 8) = TextBox_Adres.Value
        .Cells(SonSatir, 9) = TextBox_Aciklama.Value
        .Cells(SonSatir, 10) = ComboBox_Ilce.Value
        .Cells(SonSatir, 11) = ComboBox_Sehir.Text
        .Cells(SonSatir, 12) = ComboBox_Bolge.Value
        .Cells(SonSatir, 13) = ComboBox_Temsilci.Value
        .Cells(SonSatir, 14) = ComboBox_RouteDay.Value
        .Cells(SonSatir, 15) = ComboBox_YetkiliBayilik
        .Cells(SonSatir, 16) = CheckBox_AlbertGenau.Value
        .Cells(SonSatir, 17) = CheckBox_AsasPen.Value
        .Cells(SonSatir, 18) = CheckBox_ByErtTente.Value
        .Cells(SonSatir, 19) = CheckBox_Karpen.Value
        .Cells(SonSatir, 20) = CheckBox_OptimalYapi.Value
        .Cells(SonSatir, 21) = CheckBox_Palmiye.Value
        .Cells(SonSatir, 22) = CheckBox_Rsg.Value
        .Cells(SonSatir, 23) = CheckBox_Vizyon.Value
        .Cells(SonSatir, 24) = CheckBox_Winsa.Value
        .Cells(SonSatir, 25) = CheckBox_Diger.Value
        .Cells(SonSatir, 26) = TextBox_Tarih.Value
    '    .Protect sifre
    End With
    Call checkboxKontrol(SonSatir)
    Call temizle

    TextBox_Tarih = Format(Date, "dd.mm.yyyy")
   
    TextBox_Tarih.SetFocus
   
    With TextBox_Tarih
        .SelStart = 0
        .SelLength = .TextLength
    End With
'Application.ScreenUpdating = True

End Sub
.rar WİNPERAX.rar (Dosya Boyutu: 95,96 KB | İndirme Sayısı: 18)
Access Çekirgesi 
[Resim: img-cray.gif]


Son Düzenleme: 14/03/2021, 12:31, Düzenleyen: Oğuz Türkyılmaz.
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
Excel Userformda Mükerrer Kayıt Engelleme - Yazar: Oğuz Türkyılmaz - 14/03/2021, 12:25
Task