Foxtable(狐表)用户栏目专家坐堂 → 关于多条件筛选提示缺少操作数


  共有1861人关注过本帖树形打印复制链接

主题:关于多条件筛选提示缺少操作数

帅哥哟,离线,有人找我吗?
benwong2013
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:485 积分:4081 威望:0 精华:0 注册:2015/12/16 8:22:00
关于多条件筛选提示缺少操作数  发帖心情 Post By: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

在操作时,提示”申请状态“后面缺运算符后缺少操作数,请问代码应如何修改?

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110597 积分:562881 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/11/11 9:14:00 [只看该作者]

Tables("请购需求管理_Table1").Filter =Filter & " and 申请状态 = '已批准'"

 回到顶部