以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=16306)

--  作者:tungwun
--  发布时间:2012/2/8 23:14:00
--  [求助]
Dim Filter As String
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        Filter = "車牌  = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("cmbCustomer")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "打理人 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("cmbEmployee")
    If .Value IsNot 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

请问如何加入到上面的查询代码中  Tables("車輛打理").Filter = "結束日期時間 Is Null"
[此贴子已经被作者于2012-2-8 23:14:48编辑过]

--  作者:czy
--  发布时间:2012/2/8 23:22:00
--  

如果是無條件加入:

If Filter > "" Then

   Tables("車輛打理").Filter = filter & " And 結束日期時間 Is Null"

End If