Forum

Excel VB Combobox B...
 
Bildirimler
Hepsini Temizle

Excel VB Combobox Birden Fazla Tabloya Kayıt

2 Yazılar
2 Üyeler
0 Likes
512 Görüntüleme
(@serdaratacan)
Gönderiler: 244
Honorable Member
Konu başlatıcı
 

iyi günler hayırlı aksamlar arkadaşlar . Excel (Access Veritabanlı ) bir uygulamam var . access içerisine 4 adet tablo yerleştirdim. bu tablolara userformda combobox ile seçmeli nasıl kayıt edebilirim. örnek : tablo1-2-3-4 içerisinde ad soyad alan adları olsun  userformda  ad soyad textboxlara yazılıp combobox ile tablo1-2-3-4 den herhangi birine secip o tablo içine kayıt yapıcam ?

 
Gönderildi : 27/08/2011 01:33

(@ugurdasdemir)
Gönderiler: 1824
Noble Member
 

Kayıt için yaptığınız kodlamayı da yazın isterseniz.

 Örnek: 

If OptionButton1.Value = True Then tabloadi = "tablo1"
If OptionButton2.Value = True Then tabloadi = "tablo2"
If OptionButton3.Value = True Then tabloadi = "tablo3"
If OptionButton4.Value = True Then tabloadi = "tablo4"

Tanimlanan = "SELECT * FROM " & tabloadi
 
       
MsgBox "Lütfen Bos Olan Alanlari doldurun. Bos olan nesne adi: " &
Chr(13) & TextBox3.Name & " " & TextBox4.Name, vbQuestion,
"UYARI"
        Exit Sub
    End If
    If MsgBox("'" &
TextBox3.Text & "' adlı konuya ait bilgi  eklenecektir, emin
misiniz?", vbYesNo, "arslanbey") = vbYes Then
     On Error Resume Next
       '===========================
       Set rs = CreateObject("ADODB.recordset")
       Tanimlanan = "SELECT * FROM [tablo1]"
       rs.Open Tanimlanan, AdoCN, 1, 3
       rs.AddNew
    rs("konu adi") = TextBox3.Text
    rs("konu") = TextBox4.Text
    rs.Update
Call yukle
rs.Close
Set rs = Nothing
MsgBox "Veriler Başarılı Şekilde Kayıt Edildi", vbInformation, "cozumpark"
TextBox3.Text = ""
TextBox4.Text = ""
TextBox3.SetFocus
Exit Sub

 Buna göre uyarlarsanız istediğiniz olacaktır. Keza faydalı olunması için  neler yaptığınızı iletirseniz seviniriz.

 

 
Gönderildi : 01/09/2011 20:18

Paylaş: