Foxtable(狐表)用户栏目专家坐堂 → [求助]如何进行追加查询?


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

主题:[求助]如何进行追加查询?

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/18 16:54:00 [显示全部帖子]

Dim Filter As String = "1=1"
With e.Form.Controls("comboBox15")
    If .Value IsNot Nothing Then
        Filter &= " and 年度 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("comboBox1")
    If .Value IsNot Nothing Then
        Filter &= " and 接收月份 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("comboBox2")
    If .Value IsNot Nothing Then
        Filter &= " and 完成月份 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("comboBox16")
    If .Value IsNot Nothing Then
        Filter &= " and 受伤害职工姓名 = '" & .Value & "'"
    End If
End With

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/18 19:13:00 [显示全部帖子]

Dim Filter As String = "1=1"
With e.Form.Controls("comboBox15")
    If .Value IsNot Nothing Then
        Filter &= " and 年度 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("comboBox1")
    If .Value IsNot Nothing Then
        Filter &= " and (接收月份 = '" & .Value & "' or 完成月份 = '" & .Value & "')"
    End If
End With
With e.Form.Controls("comboBox2")
    If .Value IsNot Nothing Then
        Filter &= " and (完成月份 = '" & .Value & "' or 接收月份 = '" & .Value & "')"
    End If
End With

With e.Form.Controls("comboBox16")
    If .Value IsNot Nothing Then
        Filter &= " and 受伤害职工姓名 = '" & .Value & "'"
    End If
End With

 回到顶部