以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于多重条件筛选问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=130423)

--  作者:whoisvinci
--  发布时间:2019/1/21 17:43:00
--  关于多重条件筛选问题
Dim txt As String = e.Form.Controls("TextBox1").Text
Dim tbl As Table = Tables("申购信息查询_申购明细")
Dim Filter As String

If txt = "" Then
    Filter = ""
Else
    txt = "\'%" & txt & "%\'"
    Filter = "货品编号 Like " & txt & " Or 货品名称 Like " & txt & " Or 规格型号 Like " & txt & " Or 描述 Like " & txt & " Or 品牌 Like " & txt & " Or 申购用途 Like " & txt
End If
If e.Form.Controls("rdoyicai").Checked = True \' 如果采购状态选择了"已采购"
    If Filter >"" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "采购状态 = True"
    
End If
If e.Form.Controls("rdoweicai").Checked = True \' 如果采购状态选择了"未采购"
    If Filter >"" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "采购状态 = False Or 采购状态 Is Null"
    
End If

If e.Form.Controls("rdoall").Checked = True \' 如果采购状态选择了"全部"
    tbl.ApplyFilter = False

End If
If Filter > "" Then
    tbl.Filter = Filter  
End If
msgbox(Filter)


图片点击可在新窗口打开查看此主题相关图片如下:qq拼音截图未命名.jpg
图片点击可在新窗口打开查看

请问各位大牛是什么问题?


--  作者:有点蓝
--  发布时间:2019/1/21 17:46:00
--  
If txt = "" Then
    Filter = ""
Else
    txt = "\'%" & txt & "%\'"
    Filter = "(货品编号 Like " & txt & " Or 货品名称 Like " & txt & " Or 规格型号 Like " & txt & " Or 描述 Like " & txt & " Or 品牌 Like " & txt & " Or 申购用途 Like " & txt & ") "
End If

--  作者:whoisvinci
--  发布时间:2019/1/21 22:26:00
--  
谢谢蓝版,完美解决图片点击可在新窗口打开查看