以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  loadfilte 几个条件同时加载出错  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=48464)

--  作者:fubblyc
--  发布时间:2014/3/29 12:55:00
--  loadfilte 几个条件同时加载出错

各位老师好,用loadfilte 根据用户输入的条件进行加载,有几个条件同时加载,我下面这样写,出错,不知道是什么原因:

 

 

Dim Filter As String

With e.Form.Controls("门店编号")
    If .Value IsNot Nothing Then
        Filter = "归属门店代号 = \'" & .Value & "\' and "
    End If
End With

With e.Form.Controls("回访人")
    If .Value IsNot Nothing Then
        Filter+ = "回访人 = \'" & .Value & "\' and "
    End If
End With

With e.Form.Controls("销售主管")
    If .Value IsNot Nothing Then
        Filter+ = "销售主管 = \'" & .Value & "\'  "
    End If
End With

If Filter > "" Then
    DataTables("rjsytVIP回访记录").LoadFilter = Filter
MessageBox.Show(Filter)

    DataTables("rjsytVIP回访记录").Load
End If

 

调试提示:

 

---------------------------

---------------------------
归属门店代号 = \'R0039\' and
---------------------------
确定  
---------------------------


--  作者:有点甜
--  发布时间:2014/3/29 13:05:00
--  

 改一下

 


Dim Filter As String = "1=1"

With e.Form.Controls("门店编号")
    If .Value IsNot Nothing Then
        Filter = " and 归属门店代号 = \'" & .Value & "\'"
    End If
End With

With e.Form.Controls("回访人")
    If .Value IsNot Nothing Then
        Filter+ = " and 回访人 = \'" & .Value & "\'"
    End If
End With

With e.Form.Controls("销售主管")
    If .Value IsNot Nothing Then
        Filter+ = " and 销售主管 = \'" & .Value & "\'  "
    End If
End With

If Filter > "" Then
    DataTables("rjsytVIP回访记录").LoadFilter = Filter
MessageBox.Show(Filter)

    DataTables("rjsytVIP回访记录").Load
End If


--  作者:fubblyc
--  发布时间:2014/3/29 14:07:00
--  
哦哦,谢谢有点甜老师!!!学习中!!!