红色的名称写错了,去看一下控件的名称属性。
Dim Filter As StringWith e.Form.Controls("产品编号") If .Value IsNot Nothing Then Filter = "产品编号= '" & .Value & "'" End IfEnd WithIf Filter > "" Then Tables("销售出库明细").Filter = FilterEnd If