以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  模糊查询加条件  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=71089)

--  作者:seal51
--  发布时间:2015/7/4 17:40:00
--  模糊查询加条件

Dim txt As String = e.Form.Controls("产品查询").Text
Dim tbl As Table = Tables("产品库存_产品列表")
If txt = "" Then
    tbl.Filter = "库存数量 > 0.1 "
Else
    txt = "\'%" & txt & "%\'"
    tbl.Filter = "产品ID Like " & txt & " Or 缺省供应商 Like " & txt & " Or 销售产品ID Like " & txt & " Or 产品图号 Like " & txt & " Or 图纸PDF Like " & txt & " Or 产品图号 Like " & txt & " Or 产品名称 Like " & txt & " Or 产品材料 Like " & txt & " Or 产品规格 Like " & txt
End If

 

如何把“库存数量 > 0.1” 加入到tbl.Filter里面呢? 


--  作者:czy
--  发布时间:2015/7/4 18:22:00
--  
tbl.Filter = "库存数量 > 0.1 and 原条件
--  作者:seal51
--  发布时间:2015/7/4 18:36:00
--  

tbl.Filter = "库存数量 > 0.1 and "产品ID Like " & txt & " Or 缺省供应商 Like " & txt & " Or 销售产品ID Like " & txt & " Or 产品图号 Like " & txt & " Or 图纸PDF Like " & txt & " Or 产品图号 Like " & txt & " Or 产品名称 Like " & txt & " Or 产品材料 Like " & txt & " Or 产品规格 Like " & txt

 

提示,编译错误, 应为语句结束??


--  作者:seal51
--  发布时间:2015/7/4 18:40:00
--  

tbl.Filter = "库存数量 > 0.1 and 产品ID Like " & txt & " Or 缺省供应商 Like " & txt & " Or 销售产品ID Like " & txt & " Or 产品图号 Like " & txt & " Or 图纸PDF Like " & txt & " Or 产品图号 Like " & txt & " Or 产品名称 Like " & txt & " Or 产品材料 Like " & txt & " Or 产品规格 Like " & txt

 

把产品ID前面的“去掉对吗, 不过筛选库存数量 > 0.1 没起作用??


--  作者:大红袍
--  发布时间:2015/7/5 9:45:00
--  
tbl.Filter = "库存数量 > 0.1 and (产品ID Like " & txt & " Or 缺省供应商 Like " & txt & " Or 销售产品ID Like " & txt & " Or 产品图号 Like " & txt & " Or 图纸PDF Like " & txt & " Or 产品图号 Like " & txt & " Or 产品名称 Like " & txt & " Or 产品材料 Like " & txt & " Or 产品规格 Like " & txt & ")"