Foxtable(狐表)用户栏目专家坐堂 → [求助]筛选查询窗口设计成包含


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

主题:[求助]筛选查询窗口设计成包含

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


加好友 发短信
等级:幼狐 帖子:98 积分:860 威望:0 精华:0 注册:2020/5/28 10:53:00
[求助]筛选查询窗口设计成包含  发帖心情 Post By:2021/3/10 10:05:00 [只看该作者]

Dim Filter As String
With
e.Form.Controls("cmbProduct")
   
If .Value IsNot Nothing Then
        Filter =
"产品 = '" & .Value & "'"
   
End If
End
With
With
e.Form.Controls("cmbCustomer")
   
If .Value IsNot Nothing Then
       
If Filter > "" Then
            Filter = Filter &
" And "
       
End If
        Filter = Filter &
"客户 = '" & .Value & "'"
   
End If
End
With
With
e.Form.Controls("cmbEmployee")
   
If .Value IsNot Nothing Then
       
If Filter >"" Then
            Filter = Filter &
" And "
       
End If
        Filter = Filter &
"雇员 = '" & .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 &
"日期 >= #" & .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 &
"日期 <= #" & .Value & "#"
   
End If
End
With
If
e.Form.Controls("rdoYifu").Checked = True ' 如果付款状态选择了"已付"
   
If Filter >"" Then
        Filter = Filter &
" And "
   
End If
    Filter = Filter &
"已付款 = True"
End
If
If
e.Form.Controls("rdoWeifu").Checked = True ' 如果付款状态选择了"未付"
    If
Filter >"" Then
       
Filter = Filter & " And "
   
End If
   
Filter = Filter & "已付款 = False Or 已付款 Is Null"
End If
If
Filter > "" Then
    Tables(
"订单").Filter = Filter
End If


这是使用指南的查询窗口,请问这个怎么改成包含,还有多选又该怎么设计


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


加好友 发短信
等级:超级版主 帖子:111422 积分:567186 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/3/10 10:37:00 [只看该作者]

参考:http://www.foxtable.com/webhelp/topics/0102.htm

包含看like的用法,如:Filter = Filter & "雇员 like '%" & .Value & "%'"
多选看in的用法,如:Filter = Filter & "雇员 in ('%" & .Value.replace(",","','") & "%')"

 回到顶部