Dim Filter As String = "1=1" With e.Form.Controls("中康编码1") If .Value IsNot Nothing Then Filter = Filter & " and 中康编码 = '" & .Value & "'" End If End With With e.Form.Controls("成品编码2") If .Value IsNot Nothing Then Filter = Filter & " and 成品编码 = '" & .Value & "'" End If End With