Dim dr As DataRow = DataTables("当月采购").Find("供应商 = '" & gys & "' and 单号='" & dh & "' and 物料编码='" & bm & "' and 数量='" & sl & "'")
改成
Dim dr As DataRow = nothing