If e.Form.Controls("yibi").Checked = True '如果闭环状态选择了"已闭" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "配件名称 <> '待料' or 配件名称 is null" End If If e.Form.Controls("weibi").Checked = True '如果闭环状态选择了"未闭" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "配件名称 = '待料'" End If