Foxtable(狐表)用户栏目专家坐堂 → 多选的时候,只显示一个,其他两个备选的不显示,应该怎么改?


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

主题:多选的时候,只显示一个,其他两个备选的不显示,应该怎么改?

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


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
多选的时候,只显示一个,其他两个备选的不显示,应该怎么改?  发帖心情 Post By:2015/11/5 23:52:00 [只看该作者]

Dim Filter As String
With e.Form.Controls("userfin")
    If .Value IsNot Nothing Then
        Filter = "name = '" & .Value & "'"
    End If
End With

With e.Form.Controls("userfin1")
    If .Checked = True Then
        Filter = "状态 = '未送'"
    End If
End With
With e.Form.Controls("ok")
    If .Checked = True Then
        Filter = "状态 = 'ok' "
    End If
End With
With e.Form.Controls("new")
    If .Checked = True Then
        Filter = "状态 = '新'"
    End If
End With


With e.Form.Controls("cmbEmployee")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "shangcheng = '" & .Value & "'"
    End If
End With
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "time >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "time <= #" & .Value & "#"
    End If
End With

If Filter > "" Then
    Tables("qt2").Filter = Filter
'     Tables("weixin").Filter = Filter
End If


此主题相关图片如下:捕获.png
按此在新窗口浏览图片

 

这个图我设计的是 把选择按钮都选上的话,三个相应的结果都能出来才对,

但是现在,如果我选中 两个,或者三个的话,

 

结果只会 筛选其中的一个,代码如上 麻烦指点一下


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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2015/11/6 8:19:00 [只看该作者]

Dim Filter As String = "1=1"
With e.Form.Controls("userfin")
    If .Value IsNot Nothing Then
        Filter = " name = '" & .Value & "'"
    End If
End With

Dim f2 As String
With e.Form.Controls("userfin1")
    If .Checked = True Then
        f2 = "状态 = '未送'"
    End If
End With
With e.Form.Controls("ok")
    If f2 > "" Then
        f2 = f2 & " or "
    End If
    If .Checked = True Then
        f2 &= "状态 = 'ok' "
    End If
End With
With e.Form.Controls("new")
    If f2 > "" Then
        f2 = f2 & " or "
    End If
    If .Checked = True Then
        f2 &= "状态 = '新'"
    End If
End With
If f2 > "" Then
    Filter = Filter & " and (" & f2 & ")"
End If

With e.Form.Controls("cmbEmployee")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "shangcheng = '" & .Value & "'"
    End If
End With
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "time >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "time <= #" & .Value & "#"
    End If
End With

If Filter > "" Then
    Tables("qt2").Filter = Filter
    '     Tables("weixin").Filter = Filter
End If

 


 回到顶部