ElseIf Option2.Value = True Then
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open ConnString
Dim strin1$, strin2$
strin1 = CStr(DTPicker1.Value)
strin2 = CStr(DTPicker2.Value)
strSql = "select * from kcxx where Rksj between ' " & strin1 & " 'and ' " & strin2 & " ' "
rs.Open strSql, Conn, 3, 3
Set DataGrid1.DataSource = rs
With DataGrid1
.Columns(0).Width = 1000
.Columns(0).Caption = "库存货物ID"
.Columns(1).Width = 1000
.Columns(1).Caption = "货物状态"
.Columns(2).Width = 1000
.Columns(2).Caption = "入库时间"
.Columns(3).Width = 1000
.Columns(3).Caption = "库存量"
.Columns(4).Width = 1000
.Columns(4).Caption = "最大库存量"
End With
DataGrid1.Visible = True
Exit Sub
我现在改成这个样子对吗?
不过还是出错误信息,标准表达式中类型不匹配