10个产品对应10个型号,譬如产品A型号甲,产品A型号乙,产品B型号甲,产品B型号乙。搜索产品时是精准搜索,搜索型号是模糊搜索,譬如搜索产品A,然后搜索型号“乙”,得出是产品A和型号乙。而用模糊筛选功能,却得出所有型号乙的产品。代码该怎么改呢?
With e.Form.Controls("textbox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "产品 = '" & .Value & "'"
If tbl Is Nothing Then
msgbox("没有数据")
End If
End If
End With
With e.Form.Controls("textbox4")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = "([型号] like '%" & .Value & "%')"
'Filter = Filter & "型号 = '" & .Value & "'"
If tbl Is Nothing Then
msgbox("没有数据")
End If
End If
End With