Foxtable(狐表)用户栏目专家坐堂 → [求助]查询代码如何组合查询?


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

主题:[求助]查询代码如何组合查询?

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


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

Dim Filter As String = "1=1"
With e.Form.Controls("comboBox1")
    If .Value IsNot Nothing Then
        Filter &= " and 批次 = '" & .Value & "'"
    End If
End With


With e.Form.Controls("comboBox15")
    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
With e.Form.Controls("comboBox01")
    If .Value IsNot Nothing Then
        Filter &= " and 鉴定类别 = '" & .Value & "'"
    End If
End With

 


If e.Form.Controls("yjd").Checked = True ' 如果付款状态选择了"已付"

    Filter = Filter & " and 是否鉴定 = true"
End If
If e.Form.Controls("wjd").Checked = True ' 如果付款状态选择了"未付"
    Filter = Filter & " and 是否鉴定 = false"
End If

msgbox(filter)

If Filter > "" Then
    Dim str As String = Tables("劳动能力鉴定_鉴定").DataTable.GetComboListString("_Identify", filter)
    Tables("劳动能力鉴定_鉴定").Filter = "_Identify in (" & str.replace("|", ",") & ")"
End If
'Tables("劳动能力鉴定_鉴定").Sort = "编号"


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


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

Tables("劳动能力鉴定_鉴定").Filter = "_Identify in (" & str.replace("|", ",") & ")"

 

改成

 

Tables("劳动能力鉴定_鉴定").Filter = "_Identify in (-1," & str.replace("|", ",") & ")"


 回到顶部