DataRowDeleting事件,加入如下代码,删除原本的代码
Dim dr As DataRow =e.DataRow.GetParentRow("表A")
If dr IsNot Nothing Then
Dim fdr As DataRow = e.DataTable.Find("第二列 = '" & e.DataRow("第二列") & "' and 明细分段 is not null and _Identify <> " & e.DataRow("_Identify"), "_sortkey desc")
If fdr IsNot Nothing Then
dr("库存分段") = fdr("明细分段")
End If
End If