- Katılım
- 12 Ocak 2009
- Mesajlar
- 838
- Excel Vers. ve Dili
- 2003
- Altın Üyelik Bitiş Tarihi
- 07-02-2024
Merhaba arkadaşlar.
Comboboxlara aşağıdaki şekilde access veri tabanından verileri alıyorum.
Ancak kayıt yaparken veya kaydı güncellerken ilgili verinin index numarasını kaydediyor. Sorunun çözümünü bulamadım.


Comboboxlara aşağıdaki şekilde access veri tabanından verileri alıyorum.
Kod:
ComboBox1.Clear
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Call BAGLANTI
rs.Open "select KIMLIK,program_portal_no from [veriler]", baglan, 1, 1
With ComboBox1
.RowSource = Empty
.ColumnCount = 2
.ColumnWidths = "0;10"
If rs.RecordCount > 0 Then .Column = rs.GetRows
End With
rs.Close
Set rs = Nothing
ComboBox2.Clear
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Call BAGLANTI
rs.Open "select KIMLIK,agi_durumu,oranı from [agi]", baglan, 1, 1
With ComboBox2
.RowSource = Empty
.ColumnCount = 2
.ColumnWidths = "0;10"
If rs.RecordCount > 0 Then .Column = rs.GetRows
End With
rs.Close
Set rs = Nothing

Kod:
Private Sub cmdKaydet_Click()
If Not FrameTest Then Exit Sub
If OptionButton1.Value = True Then 'Yeni Kayıt
If TextBox1.Text = "" Then
TextBox1.SetFocus
MsgBox ("Lütfen Adı - Soyad Bilgisi Girin..."), vbInformation, "...."
Exit Sub
End If
If Me.TextBox2 <> "" Then
If TCNumarasiKayitliMi(TextBox2.Value, 0) = True Then Exit Sub
End If
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Call BAGLANTI
rs.Open "select top 1 * from katılımcı_listesi ", baglan, 1, 3
rs.AddNew
rs("program_portal_no") = ComboBox1.Value
rs("adı_soyadı") = TextBox1.Value
rs("tc_kimlik") = TextBox2.Value
rs("program_başlama_tarihi") = TextBox3.Value
rs("program_bitiş_tarihi") = TextBox4.Value
rs("işe_başlama_tarihi") = TextBox5.Value
rs("işten_çıkış_tarihi") = TextBox6.Value
rs("banka_hesapno") = TextBox7.Value
rs("agi_durumu") = ComboBox2.Value
rs("agi_oranı") = TextBox8.Value
rs.Update
listeye_al
temizle
rs.Close
End If
If OptionButton2.Value = True Then 'Güncelle
If TextBox1.Text = "" Then
TextBox1.SetFocus
MsgBox ("Lütfen Listeden çift tık ile kişi seçin ..."), vbInformation, "...."
Exit Sub
End If
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Call BAGLANTI
rs.Open "select * from katılımcı_listesi where katılımcı_listesi.KIMLIK like '%" & txKimlik.Text & "%'", baglan, 1, 2
If rs.RecordCount > 0 Then
rs("program_portal_no") = ComboBox1.Value
rs("adı_soyadı") = TextBox1.Value
rs("tc_kimlik") = TextBox2.Value
rs("program_başlama_tarihi") = TextBox3.Value
rs("program_bitiş_tarihi") = TextBox4.Value
rs("işe_başlama_tarihi") = TextBox5.Value
rs("işten_çıkış_tarihi") = TextBox6.Value
rs("banka_hesapno") = TextBox7.Value
rs("agi_durumu") = ComboBox2.Value
rs("agi_oranı") = TextBox8.Value
rs.Update
MsgBox TextBox1 & " adlı kayıt başarı ile güncellendi.", , "...."
End If
rs.Close
listeye_al
temizle
End If

Ekli dosyalar
-
76.7 KB Görüntüleme: 4
