参考:http://www.foxtable.com/webhelp/scr/1058.htm
Dim Filter As String
With e.Form.Controls("仓库")
If .Value IsNot Nothing Then
Filter = "仓库属性 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Dim txt As String = "'%" & .txt & "%'"
Filter = Filter & "(商品ID Like " & txt & " Or 商品名称 Like " & txt & " Or 拼音码 Like " & txt & ")"
End If
End With
Tables("产品").Filter = Filter