以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于筛选条件的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72690)

--  作者:bbnnmm2015
--  发布时间:2015/8/4 17:19:00
--  关于筛选条件的问题

专家你好,

Dim Filter As String
With e.Form.Controls("TextBox14")
    If .Value IsNot Nothing Then
        Filter = "配送公司名称 = \'" & .Value & "\'"
    End If
 Tables("供货价格及数量审定_table1").Filter = Filter

运行没问题,

但是我要加上"本年度供货价 IS  NULL or 暂定供货量 is  null"的筛选条件,怎么加,试了很多次没成功


--  作者:blsu33
--  发布时间:2015/8/4 18:49:00
--  
Dim txb As WinForm.TextBox = e.Form.Controls("TextBox14")
If txb.Value<>"" Then
    Tables("供货价格及数量审定_table1").Filter = "[配送公司名称]= \'" & txb.Value & "\' and [本年度供货价] Is Null And [暂定供货量] Is Null"
End If

试试

--  作者:大红袍
--  发布时间:2015/8/4 19:14:00
--  

Dim Filter As String = "1=1"
With e.Form.Controls("TextBox14")
    If .Value IsNot Nothing Then
        Filter = " and 配送公司名称 = \'" & .Value & "\'"
    End If
End With
Tables("供货价格及数量审定_table1").Filter = Filter & " and  ([本年度供货价] Is Null or [暂定供货量] Is Null)"