此主题相关图片如下:qq图片20160921153605.png
想做一个模糊查询,怎么做,我的代码如下,但是这个是精准查询,我想要做模糊查询
Dim Filter As String
Dim str As String
With e.Form.Controls("TextBoxZBH")
If .Value IsNot Nothing Then
Filter = "自编号 = " & .Value & " "
End If
End With
With e.Form.Controls("TextBoxCPH")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "车牌号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBoxName")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = "车辆名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBoxGS")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "所属公司 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBoxLX")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
str = "'%" & .Value & "%'"
Filter = Filter & "运行路线 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("候运客运车辆明细表").Filter = Filter
End If
[此贴子已经被作者于2016/9/21 15:43:53编辑过]