Private Sub Command2_Click()
Dim sqlString As String
sqlString = "Select * From detail WHERE code = cint('" & Combo1.Text & "') and s_date >= datevalue('" & DTPicker1.Value & "') and s_date <= datevalue('" & DTPicker2.Value & "') order by s_date"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open sqlString, cn, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs
End Sub