以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于多条件筛选提示缺少操作数 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92724) |
-- 作者:benwong2013 -- 发布时间:2016/11/11 8:42:00 -- 关于多条件筛选提示缺少操作数 Dim Filter As String With e.Form.Controls("bmdaima") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "convert(单位代码, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("供应商名称") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "convert(供应商名称, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("TextBox1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "convert(物料名称, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "convert(订购状态, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("ComboBox2") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "convert(仓库代码, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("DateTimePicker1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "请购日期 >= #" & .Value & "#" End If End With With e.Form.Controls("DateTimePicker2") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "请购日期 <= #" & .Value & "#" End If End With If Filter > "" Then Tables("请购需求管理_Table1").Filter =Filter & "申请状态 = \'已批准\'" End If 在操作时,提示”申请状态“后面缺运算符后缺少操作数,请问代码应如何修改?
|
-- 作者:有点蓝 -- 发布时间:2016/11/11 9:14:00 -- Tables("请购需求管理_Table1").Filter =Filter & " and 申请状态 = \'已批准\'" |