多条件查询下的条件拼接问题
我设置的代码是下面这样
For i = 1 To 4
Select Case i
Case 1
If Text1 <> "" Then
cc = Text1.Text
dd = " 物料编码 like " & cc & " Or 物料名称 Like " & cc & ""
End If
Case 2
If Check1(2).Value = 1 Then
cc = Combo1(1).Text
If dd <> "" Then
dd = dd & " and 发放状态 = " & cc
Else
dd = " 发放状态 = " & cc
End If
End If
Case 3
If Check1(3).Value = 1 Then
cc = Combo1(2).Text
If dd <> "" Then
dd = dd & " and 负责人 = " & cc
Else
dd = " 负责人 = " & cc
End If
End If
Case 4
If Check1(4).Value = 1 Then
cc = Combo1(3).Text
If dd <> "" Then
dd = dd & " and 待处理人 = " & cc
Else
dd = " 待处理人 = " & cc
End If
End If
End Select
Next
SQLm = "Select * From Mstyle where" & dd
这样拼接的问题出在哪?