Private Sub Label5_Click()
Dim rs As ADODB.Recordset
Dim strQuery As String
Dim counter, counter1 As Integer
Set Conn = New ADODB.Connection
strDSN = "DSN=jx"
strQuery = "select * from axs"
Conn.Open strDSN
Set rs = Conn.Execute(strQuery)
Do
If 0 <= y(DTPicker1, rs("xsrq")) And 0 <= y(rs("xsrq"), DTPicker2) Then
counter = counter + rs.Fields("xssl").Value
counter1 = counter1 + rs.Fields("hj").Value
End If
rs.MoveNext
Loop Until rs.EOF
Text1.Text = counter
Text2 = counter1
End Sub