各位高手,请帮我看下,我的订单明细表中的累计出货数,每次会根据出库明细表中的数据自动更新累计出货数,但是每次保存后在打开就会清零了,这是为什么呢?我找了2天也没找到原因,帮我看下吧,谢谢!
此主题相关图片如下:cc.jpg

还有我希望可以根据出库明细表中的开piao情况自动更新订单明细表中的开piao情况,但是如果变更了库存明细表中的 开piao否 列数据,订单明细表中的开piao否 数据不会发生变化。
说明:订单号,产品号,订单行号三个因素决定唯一的一个子订单,每个子订单可能有若干行出库明细,即分别出库,若干次出库可能分几次开piao,不一定一起开piao。
出库明细DataColChanged 里面的代码是:
If e.DataCol.name = "开piao否"
Dim filter As String = " [客户订单号] = '"& e.DataRow("客户订单号") & "' And [订单行号] = '"& e.DataRow("订单行号") & "' "
DataTables("订单明细表").DataCols("开piao否").RaiseDataColChanged(filter)
End If
订单明细DataColChanged 里面的代码是:
If e.DataCol.name = "开piao否" Then
Dim i As Integer
i=0
Dim drs As List(Of DataRow)
'Dim drs As DataRow
drs = DataTables("出库明细").Select( " [客户订单号] = '"& e.DataRow("客户订单号") & "' And [订单行号] = '"& e.DataRow("订单行号") & "' " )
Dim c2 As Integer = e.DataRow.GetChildRows("drs").Count
For Each dr As DataRow In drs
If dr("开piao否") = True Then
i=i+1
End If
Next
If i = c2 And e.DataRow("未交货数量") <= 0 Then
e.DataRow("开piao否") = True
End If
End If
[此贴子已经被作者于2014-12-25 23:54:41编辑过]