• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Gizli textboxtaki veri kaydedilmesin

yamahato

Altın Üye
Katılım
20 Mayıs 2009
Mesajlar
236
Excel Vers. ve Dili
excel 2007
Kolay gelsin
Benim bir userform3 var.Bu userformda 13 adette textbox var.Program gereği ilk 8 textbox görünür halde Geriye kalan 5 textbox gizli.Bir commandbutton ile istenilirse görünür oluyor.Unutmadan birde kaydet butonumuz var.
Şimdi sorum şu bu gizli olan textboxlar görünür hale geldiğinde hangi kod ile kayıt hatalarını önlemek için içerikleri boş ise kayıt yapmamasını ve bana uyarı vermesini sağlarım.Ben aşağıdaki kodu yazdım ama olmuyor.
Kod:
Private Sub CommandButton3_Click()
If TextBox1.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox1.SetFocus: Exit Sub
If TextBox2.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox2.SetFocus: Exit Sub
If TextBox10.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox10.SetFocus: Exit Sub
If TextBox11.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox11.SetFocus: Exit Sub
If TextBox3.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox3.SetFocus: Exit Sub
If TextBox4.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox4.SetFocus: Exit Sub
If TextBox5.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox5.SetFocus: Exit Sub
If TextBox8.Value = Empty Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox8.SetFocus: Exit Sub
If TextBox12.Visible = True Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox12.SetFocus: Exit Sub
If TextBox13.Visible = True Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox13.SetFocus: Exit Sub
If TextBox14.Visible = True Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox14.SetFocus: Exit Sub
If TextBox15.Visible = True Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox15.SetFocus: Exit Sub
If TextBox16.Visible = True Then MsgBox ("Zorunlu alanları doldurunuz."), vbInformation, "DOĞAN YAZILIM": TextBox16.SetFocus: Exit Sub
Son_Dolu_Satir = Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("A65536").End(xlUp).Row
Bos_Satir = Son_Dolu_Satir + 1
If TextBox1.Text <> "" Then
If TextBox2.Text <> "" Then
If TextBox3.Text <> "" Then
If TextBox4.Text <> "" Then
If TextBox5.Text <> "" Then
If TextBox8.Text <> "" Then
If TextBox10.Text <> "" Then
If TextBox12.Text <> "" Then
If TextBox13.Text <> "" Then
If TextBox14.Text <> "" Then
If TextBox15.Text <> "" Then
If TextBox16.Text <> "" Then
End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("A" & Bos_Satir).Value = _
Application.WorksheetFunction.Max(Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("A:A")) + 1

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("B" & Bos_Satir).Value = TextBox1.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("C" & Bos_Satir).Value = TextBox2.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("D" & Bos_Satir).Value = TextBox10.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("E" & Bos_Satir).Value = TextBox3.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("F" & Bos_Satir).Value = TextBox4.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("G" & Bos_Satir).Value = TextBox5.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("L" & Bos_Satir).Value = TextBox8.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("I" & Bos_Satir).Value = TextBox12.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("H" & Bos_Satir).Value = TextBox13.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("J" & Bos_Satir).Value = TextBox14.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("K" & Bos_Satir).Value = TextBox15.Text

Sheets("BAKIM ONARIM BİLGİ DEPOSU").Range("M" & Bos_Satir).Value = TextBox16.Text



Sheets("BAKIM ONARIM BİLGİ DEPOSU").Select

MsgBox "KAYIT İŞLEMİ TAMAMLANMIŞTIR", vbOKOnly, "GİRİŞ"



' *************** kayıt sonrası temizlik ***************
 
TextBox12.Value = "": TextBox13.Value = "": TextBox14.Value = ""
TextBox15.Value = "": TextBox16.Value = "":



End Sub
 

Ekli dosyalar

Umarım yardımcı olursunuz.Saygılar.
 
Geri
Üst