Kod:
Sub SAY()
If ComboBox1.Value <> "" And ComboBox2.Value = "" And ComboBox3.Value = "" Then
TextBox1.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'ALİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'")(0)
TextBox2.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'VELİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'")(0)
TextBox3.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'AHMET' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'")(0)
ElseIf ComboBox1.Value = "" And ComboBox2.Value <> "" And ComboBox3.Value = "" Then
TextBox1.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'ALİ' and [ADI] like '" & ComboBox2.Value & "%'")(0)
TextBox2.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'VELİ' and [ADI] like '" & ComboBox2.Value & "%'")(0)
TextBox3.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'AHMET' and [ADI] like '" & ComboBox2.Value & "%'")(0)
ElseIf ComboBox1.Value = "" And ComboBox2.Value = "" And ComboBox3.Value <> "" Then
TextBox1.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'ALİ' and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
TextBox2.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'VELİ' and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
TextBox3.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'AHMET' and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
ElseIf ComboBox1.Value <> "" And ComboBox2.Value <> "" And ComboBox3.Value = "" Then
TextBox1.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'ALİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [ADI] like '" & ComboBox2.Value & "%'")(0)
TextBox2.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'VELİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [ADI] like '" & ComboBox2.Value & "%'")(0)
TextBox3.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'AHMET' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [ADI] like '" & ComboBox2.Value & "%'")(0)
ElseIf ComboBox1.Value <> "" And ComboBox2.Value = "" And ComboBox3.Value <> "" Then
TextBox1.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'ALİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
TextBox2.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'VELİ' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
TextBox3.Value = baglan.Execute("select count([ADI]) from [LİSTE] where [ADI] = 'AHMET' and [CALISAN_KODU] like '" & ComboBox1.Value & "%'" & "and [DOGUM_TARIHI] like '" & ComboBox3.Value & "%'")(0)
End If
End Sub