以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  筛选空值失效  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=148758)

--  作者:fendouww
--  发布时间:2020/4/14 22:17:00
--  筛选空值失效
筛选空值失效,怎么都不能去掉已付的
图片点击可在新窗口打开查看此主题相关图片如下:1.jpg
图片点击可在新窗口打开查看

Dim hh As WinForm.DateTimePicker = Forms("员工表").Controls("DateTimePicker1")
Dim ii As WinForm.DateTimePicker = Forms("员工表").Controls("DateTimePicker2")

Dim ll As WinForm.CheckBox = Forms("员工表").Controls("CheckBox1")
Dim lk As WinForm.CheckBox = Forms("员工表").Controls("CheckBox2")




Dim Filter As String
Filter = "[_Identify] is not null"
If hh.value IsNot Nothing AndAlso ii.value IsNot Nothing
    vars("startdate") = hh.value
    vars("enddate") = ii.value
    Filter = Filter & " and " & "[交工日期] >= \'" & hh.Value & "\' and [交工日期] <= \'" & ii.Value & "\'"
End If
If ll.Checked = True AndAlso lk.Checked = False Then
    Filter = Filter & " and " & "[已付] = 1"
End If

If lk.Checked = True AndAlso ll.Checked = False Then
    Filter = Filter & " and " & "([已付] is null or [已付] <> 1)"
End If
Tables("员工表.工资结算").Filter = Filter

--  作者:有点蓝
--  发布时间:2020/4/14 22:31:00
--  
Dim Filter As String
Filter = "[_Identify] is not null"
If hh.value <> Nothing AndAlso ii.value <> Nothing
    vars("startdate") = hh.value
    vars("enddate") = ii.value
    Filter = Filter & " and " & "[交工日期] >= \'" & hh.Value & "\' and [交工日期] <= \'" & ii.Value & "\'"
End If
If ll.Checked = True AndAlso lk.Checked = False Then
    Filter = Filter & " and " & "[已付] = true"
End If

If lk.Checked = True AndAlso ll.Checked = False Then
    Filter = Filter & " and " & "([已付] is null or [已付] = false)"
End If
Tables("员工表.工资结算").Filter = Filter