以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]空值筛选的代码,出错,如何修改,谢谢  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=191068)

--  作者:hrw68529
--  发布时间:2024/3/25 10:28:00
--  [求助]空值筛选的代码,出错,如何修改,谢谢
下面一段代码,标红的部分,当面试室为空值时,进行筛选,代码不正确,请专家给指导,谢谢
Dim Filter As String
With e.Form.Controls("考生类别")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "考生类别 = \'" & .Value & "\'"
    End If
End With


With e.Form.Controls("面试室")
    If .Value Is Nothing Then
        If Filter ="" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "面试室 = \'" & .Value & "\'"
    End If
End With

If Filter > "" Then
    Tables("号对人_笔试").Filter = Filter
End If

--  作者:有点蓝
--  发布时间:2024/3/25 10:34:00
--  
If .Value Is Nothing Then
改为
If .Value IsNot Nothing Then

--  作者:hrw68529
--  发布时间:2024/3/25 10:39:00
--  
有点蓝,改了后,还是不行,没反应
--  作者:有点蓝
--  发布时间:2024/3/25 10:53:00
--  
说明没有符合条件的数据
--  作者:hrw68529
--  发布时间:2024/3/25 10:58:00
--  
只查找空值的行


--  作者:有点蓝
--  发布时间:2024/3/25 11:04:00
--  

--  作者:hrw68529
--  发布时间:2024/3/25 11:19:00
--  
谢谢有点蓝,已解决,非常感谢!