If r.IsNull("封装") Then filter = "品名 ='" & r("品名").replace("'", "''") & "' and 区域='" & r("区域") &"' And 封装 Is null And 仓库 = '现货'" Else filter = "品名 ='" & r("品名").replace("'", "''") & "' and 区域='" & r("区域") &"' And 封装='" & r("封装") &"' And 仓库 = '现货'" End If