各位老师,有一疑问需要各位解决一下.
表中代码
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "物料编码"
If dr.IsNull("物料编码") = False Then
Dim dr1,dr2 As DataRow
dr1 = DataTables("表A").Find("[物料编码] = '" & e.DataRow("物料编码") & "' and [_Identify] < '" & e.DataRow("_Identify") & "'")
If dr1 IsNot Nothing Then
dr("库存") = dr1("出货后库存")
End If
Else
dr("库存") = Nothing
End If
End Select
我的想法是,根据 物料编码,自动取上一个物料编码的 出货后库存 值..
现在问题是:某一物料编码再表中出现多次,,,,而后面出现的时候,,dr("库存") = dr1("出货后库存") 得到的值都是第一次
的 dr1("出货后库存") ; 并不是前一次出货后所得到的库存数

此主题相关图片如下:1.png