主题:[讨论]标准表达式中数据类型不匹配,看了半天,不知道哪里错
Dim sql2 As String
For i = 0 To C1.UBound
If C1(i).Text <> C1(i).Tag Then
sql2 = sql2 + " and " + C1(i).Tag & "=" & C1(i).Text
End If
Next i
If sql2 <> "" Then
sql2 = Mid(sql2, 5, Len(sql2))
sql2 = "select * from 货品管理 where" + sql2
Rs.Open sql2, Conn, 1, 3
MsgBox Rs.RecordCount, 0 + 64, ""
Rs.Close
Else
MsgBox "请输入搜索条件", 0 + 64, "提示"
End If
Rs.Open sql2, Conn, 1, 3
出错时这句是黄色的
For i = 0 To C1.UBound
If C1(i).Text <> C1(i).Tag Then
sql2 = sql2 + " and " + C1(i).Tag & "=" & C1(i).Text
End If
Next i
If sql2 <> "" Then
sql2 = Mid(sql2, 5, Len(sql2))
sql2 = "select * from 货品管理 where" + sql2
Rs.Open sql2, Conn, 1, 3
MsgBox Rs.RecordCount, 0 + 64, ""
Rs.Close
Else
MsgBox "请输入搜索条件", 0 + 64, "提示"
End If
Rs.Open sql2, Conn, 1, 3
出错时这句是黄色的