Select Case e.DataCol.Name
Case "盘点数量","成本价","盘点行号","物料编码","库位","储位","负责人","盘点人","盘点备注"
msgbox("1")
e.DataRow("盘点金额") = e.DataRow("成本价") * e.DataRow("盘点数量")
e.DataRow("盘点差异") = e.DataRow("盘点数量") - e.DataRow("账面数量")
e.DataRow("仓库结存") = e.DataRow("盘点数量")
msgbox("2")
DataTables("盘点记录").save()
Dim pr7 As DataRow
'pr7 = DataTables("产品资料").Find("物料编码='" & e.NewValue & "'")
pr7 =DataTables("产品资料").SQLFind("物料编码='" & e.DataRow("物料编码") & "'")
If pr7 IsNot Nothing Then
msgbox("3")
Dim pr06 As DataRow
pr06 = DataTables("盘点记录").SQLFind("物料编码 = '" & e.DataRow("物料编码") & "' and [_identify] <> " & e.DataRow("_identify"),"盘点日期 desc")
'pr6 =DataTables("盘点记录").Find("物料编码 ='" & e.DataRow("物料编码") & "'")
If pr06 IsNot Nothing Then
msgbox("4")
pr7("盘点数量") = pr06("盘点数量")
msgbox("5")
pr7("盘点金额") = pr06("盘点金额")
pr7("盘点差异") = pr06("盘点差异")
pr7("盘点备注") = pr06("盘点备注")
pr7("盘点人") = pr06("盘点人")
pr7("库位") = pr06("库位")
pr7("储位") = pr06("储位")
pr7("负责人") = pr06("负责人")
pr7("成本价") = pr06("成本价")
msgbox("6")
DataTables("产品资料").save()
End If
End If
Dim pr As DataRow
pr = DataTables("盘点单").Find("盘点单号 = '" & e.DataRow("盘点单号") & "'")
'DataTables("盘点单").DataCols("盘点单号").RaiseDataColChanged(pr)
''msgbox("7")
'pr.save
If pr IsNot Nothing Then
pr("批次数量") = DataTables("盘点记录").sqlCompute("sum(盘点数量)","盘点单号 = '" & pr("盘点单号") & "'")
pr("批次金额") = DataTables("盘点记录").sqlCompute("sum(盘点金额)","盘点单号 = '" & pr("盘点单号") & "'")
pr("批次款数") = DataTables("盘点记录").sqlCompute("count(物料名称)","盘点单号 = '" & pr("盘点单号") & "'")
pr.save
End If
End Select
其中这段有提示通过但是实际没有赋值成功:
Dim pr06 As DataRow
pr06 = DataTables("盘点记录").SQLFind("物料编码 = '" & e.DataRow("物料编码") & "' and [_identify] <> " & e.DataRow("_identify"),"盘点日期 desc")
'pr6 =DataTables("盘点记录").Find("物料编码 ='" & e.DataRow("物料编码") & "'")
If pr06 IsNot Nothing Then
msgbox("4")
pr7("盘点数量") = pr06("盘点数量")
msgbox("5")
pr7("盘点金额") = pr06("盘点金额")
pr7("盘点差异") = pr06("盘点差异")
pr7("盘点备注") = pr06("盘点备注")
pr7("盘点人") = pr06("盘点人")
pr7("库位") = pr06("库位")
pr7("储位") = pr06("储位")
pr7("负责人") = pr06("负责人")
pr7("成本价") = pr06("成本价")
msgbox("6")
DataTables("产品资料").save()
谢谢!