以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  查询窗口问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72253)

--  作者:cuicuibing
--  发布时间:2015/7/27 8:49: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

上边的条件第一个如果 产品不是等于一个如: 产品等于 "pd001,pd002,pd003,..."中的任何一个都可以。
语法怎么写  
这样写不对, 这里这个条件应该怎么用。      Filter = "产品  in \'" & .Value.replace(",","\',\'")& "\'"


--  作者:大红袍
--  发布时间:2015/7/27 9:06:00
--  
Filter = "产品  in (\'" & .Value.replace(",","\',\'") & "\')"