Foxtable(狐表)用户栏目专家坐堂 → 筛选出错


  共有5174人关注过本帖平板打印复制链接

主题:筛选出错

美女呀,离线,留言给我吧!
nand
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:25 积分:257 威望:0 精华:0 注册:2013/4/14 9:25:00
筛选出错  发帖心情 Post By:2013/4/29 12:41:00 [只看该作者]

添加了几个组合柜控件,想能按单个或多个条件查询,代码为以下:

 

Dim Filter As String
With e.Form.Controls("业务员")
    If .Value IsNot Nothing Then
        Filter = "业务员 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("颜色")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "颜色 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("受订日期")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "受订日期 = #" & .Value & "#"
    End If
End With
With e.Form.Controls("交货日期")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "交货日期 <= #" & .Value & "#"
    End If
End With
With e.Form.Controls("部门")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & ""&.value &" = True "
    End If
End With

If Filter > "" Then
    Tables("订单排产_订单表").Filter = Filter
End If

报错是:


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

请师傅、师兄们指点


 回到顶部