(10/05/2020, 17:33)feraz yazdı:Private Sub CommandButton1_Click()
Set baglan = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
baglan.Open "provider=Microsoft.ACE.OLEDB.12.0;data source=" & ThisWorkbook.Path & "\Kasa.accdb"
sorgu = "SELECT SUM(TUTAR)as 'aa' FROM KasaKayit WHERE TARIH between #" & Format(TextBox5.Text, "mm\/dd\/yyyy") & "#" & _
"and #" & Format(TextBox6.Text, "mm\/dd\/yyyy") & "# and TUTAR >0"
rs.Open sorgu, baglan, 1, 1
TextBox1.Value = Format(rs(0), "currency")
rs.Close
sorgu = "SELECT SUM(TUTAR)as 'aa' FROM KasaKayit WHERE TARIH between #" & Format(TextBox5.Text, "mm\/dd\/yyyy") & "#" & _
"and #" & Format(TextBox6.Text, "mm\/dd\/yyyy") & "# and TUTAR <0"
rs.Open sorgu, baglan, 1, 1
TextBox2.Value = Format(rs(0), "currency")
TextBox3.Value = Format(TextBox1.Value - (-TextBox2.Value), "currency")
rs.Close
baglan.Close
Set rs = Nothing
Set baglan = Nothing
End Sub
@feraz hocam kodlara KASA_KODU alanını nasıl ekleyebilirim.