- Katılım
- 12 Ocak 2009
- Mesajlar
- 838
- Excel Vers. ve Dili
- 2003
- Altın Üyelik Bitiş Tarihi
- 07-02-2024
Merhaba arkadaşlar.
Başlıkta da belirttiğim üzere userformda bulunan comboboxlar ve listview verileri access veri tabanından alıyor.
Comboboxlar birbirleri ile bağlantılı çalışırken listview filtresi de aynı şekilde bağlantılı olabilirmi?
Normalde sorgu ile filtre yapıyor ancak comboboxlar arası bağlantı olmadan.
Örnek çalışmada frmRapor formunda bulunan Combo6, Combo5, Combo8 ve Combo7 ler birbirleri ile ilişkili olarak listview da filtre yapmasını istiyorum.
Yardımcı olacak arkadaşlara teşekkür ederim.

Başlıkta da belirttiğim üzere userformda bulunan comboboxlar ve listview verileri access veri tabanından alıyor.
C++:
Private Sub ComboBox1_Change()
On Error Resume Next
If ComboBox1.Value = "" Then
ComboBox2.Value = Empty
ComboBox3.Value = Empty
ComboBox4.Value = Empty
Else
ComboBox2.Column = baglan.Execute("select distinct [IlceAdi] from abone_listesi where IlAdi='" & ComboBox1.Value & "'").getrows
End If
End Sub
Private Sub ComboBox2_Change()
On Error Resume Next
If ComboBox1.Value = "" Then
ComboBox2.Value = Empty
ComboBox3.Value = Empty
ComboBox4.Value = Empty
Else
ComboBox3.Column = baglan.Execute("select distinct [birim_adi] from [abone_listesi] where IlAdi ='" & ComboBox1.Value & "' and IlceAdi= '" & ComboBox2.Value & "'").getrows
End If
End Sub
Private Sub ComboBox3_Change()
On Error Resume Next
If ComboBox1.Value = "" Then
ComboBox2.Value = Empty
ComboBox3.Value = Empty
ComboBox4.Value = Empty
Else
ComboBox4.Column = baglan.Execute("select distinct [abone_adi] from [abone_listesi] where IlAdi ='" & ComboBox1.Value & "' and IlceAdi= '" & ComboBox2.Value & "' and birim_adi ='" & ComboBox3.Value & "'").getrows
End If
End Sub
Normalde sorgu ile filtre yapıyor ancak comboboxlar arası bağlantı olmadan.
C++:
Private Sub TextBox9_Change()
TextBox9.Text = UCase(Replace(Replace(Replace(Replace(TextBox9.Text, "ı", "I"), "i", "İ"), "I", "I"), "İ", "İ"))
ListView1.ListItems.Clear
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Call BAGLANTI
rs.Open "select * from [fatura] WHERE [fatura].abone_no LIKE '%" & TextBox9 & "%'", baglan, 1, 1
ListCount.Caption = "Kayıtlı Fatura " & rs.RecordCount & " adettir."
sorgu
Call odeme_kontrol
End Sub
Yardımcı olacak arkadaşlara teşekkür ederim.

Ekli dosyalar
-
296.4 KB Görüntüleme: 9