Foxtable(狐表)用户栏目专家坐堂 → [求助]筛选


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

主题:[求助]筛选

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


加好友 发短信
等级:三尾狐 帖子:660 积分:5180 威望:0 精华:0 注册:2019/7/26 12:54:00
[求助]筛选  发帖心情 Post By:2023/4/6 13:26:00 [只看该作者]

Dim s1 As String  = e.Form.Controls("ComboBox1").text
Dim s2 As String  =e.Form.Controls("ComboBox2").Value
Dim s3 As String  =e.Form.Controls("ComboBox3").Value
Dim s4 As String  =e.Form.Controls("ComboBox4").Value
Dim s5 As String  =e.Form.Controls("ComboBox5").Value
Dim s6 As String  =e.Form.Controls("ComboBox6").Value
Dim s7 As String  =e.Form.Controls("ComboBox7").Value


Dim tb1234 As Table = Tables("表A")
Dim filter As String = "1=1"
If s1 > "" Then
    s1 = "'%" & s1 & "%'"
    filter = filter & " and 第一列 Like " & s1
End If

s2 = e.Form.Controls("ComboBox2").Text
If s2 > "" Then
    s2 = "'%" & s2 & "%'"
    filter = filter & " and 第一列 Like " & s2
End If


s3 = e.Form.Controls("ComboBox3").Text
If s3 > "" Then
    s3 = "'%" & s3 & "%'"
    filter = filter & " and 第一列 Like " & s3
End If


s4 = e.Form.Controls("ComboBox4").Text
If s4 > "" Then
    s4 = "'%" & s4 & "%'"
    filter = filter & " and 第一列 Like " & s4
End If
tb1234.filter = filter

上面代码,筛选出表A第一列值,含窗口控件1 2 3 4的值行,
求助,同时筛选出表A第一列值,含窗口控件1 2 3 5的值行

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110570 积分:562740 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/6 13:42:00 [只看该作者]

s4 = e.Form.Controls("ComboBox4").Text
If s4 > "" Then
    s4 = "'%" & s4 & "%'"
    filter = filter & " and 第一列 Like " & s4
End If
Dim filter2 As String = "1=1"
使用同样的方法设置第二个含窗口控件1 2 3 5的值条件
tb1234.filter = filter & “ or ” filter2 

 回到顶部