Dim find_date1 As String
Dim find_date2 As String
find_date1 = Trim(Combo1.Text) & "-" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text)
find_date2 = Trim(Combo4.Text) & "-" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text)
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select sum(金额) from 入库 where 日期 between #" & _
find_date1 & "#" & " and" & " #" & find_date2 & "#"
Adodc1.Refresh
我想将上面的这个查询出的总金额显示在text中,怎么能实现阿?帮忙写出代码,谢谢!
Dim find_date2 As String
find_date1 = Trim(Combo1.Text) & "-" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text)
find_date2 = Trim(Combo4.Text) & "-" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text)
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select sum(金额) from 入库 where 日期 between #" & _
find_date1 & "#" & " and" & " #" & find_date2 & "#"
Adodc1.Refresh
我想将上面的这个查询出的总金额显示在text中,怎么能实现阿?帮忙写出代码,谢谢!
find_date1 & "#" & " and" & " #" & find_date2 & "#"
Set Text1.DataSource = Adodc1
Text1.DataField = "money"
Adodc1.RecordSource = "select sum(金额)as money from 入库 where 日期 between #" & _
find_date1 & "#" & " and" & " #" & find_date2 & "#"
Set Text1.DataSource = Adodc1
Text1.DataField = "money"
find_date1 & "#" & " and" & " #" & find_date2 & "#"
Adodc1.Refresh Text1 = Adodc1.Recordset!总金额