以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  条件查询异常  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=186433)

--  作者:nuoyan89
--  发布时间:2023/4/29 12:31:00
--  条件查询异常
老师,我一个红色部分代码点击查询就出现如图1的异常,请帮忙看看,谢谢

图片点击可在新窗口打开查看此主题相关图片如下:1.jpg
图片点击可在新窗口打开查看

Dim Filter As String
With e.Form.Controls("材料描述1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "材料描述 like \'%" & .Value & "%\'"
    End If
End With
With e.Form.Controls("规格型号1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "规格型号 like \'%" & .Value & "%\'"
    End If
End With
With e.Form.Controls("材料编码3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "材料编码 = \'" & .Value & "\'"
    End If
End With
If Filter >"" Then
    e.Form.controls("待检处理").Table.DataTable.LoadPage = 0
    e.Form.controls("待检处理").Table.DataTable.LoadFilter =  "([检测状态] = \'待审核\' or [检测状态] = \'驳回\' or [检测状态] = \'转交\') \'and " & iif(filter>"", filter, "1=1")
    e.Form.controls("待检处理").Table.DataTable.Load
End If
With Tables("来料检测审核_待检处理")
    .Select(.RowSel, .Cols("创建日期").Index)
End  With

--  作者:有点蓝
--  发布时间:2023/4/29 14:14:00
--  
e.Form.controls("待检处理").Table.DataTable.LoadFilter =  "([检测状态] = \'待审核\' or [检测状态] = \'驳回\' or [检测状态] = \'转交\') and " & filter