改成
With e.Form.Controls("节点代号1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "节点代号 like '%" & .Value & "%'" End IfEnd With