看不出什么问题,自己调试一下,看进入的是哪个流程,自己看看判断条件是否正确……
cmd3.CommandText = "Select " & dr("后横线计算公式") & " From {YW_销售订单明细} where [_Identify] = " & e.DataRow("_Identify") '根据需要修改主键和表名
dr("后横线长") = cmd3.ExecuteScalar
dr.Save() '必须保存一下
msgbox(1)
'并线单价计算
dr("套线核算单价") = ((dr("洞高") * dr("前立线基价") * 2 + dr("洞宽") * dr("前门头基价")) + (dr("洞高") * dr("后立线基价") * 2 +dr("洞宽") * dr("后门头基价"))) * 0.001
dr.Save() '必须保存一下
ElseIf (dr.IsNull("洞高")=False AndAlso dr.IsNull("洞宽")=False) AndAlso (dr.IsNull("前立线基价")=False AndAlso dr.IsNull("前门头基价")=False AndAlso dr.IsNull("后立线基价")=False AndAlso dr.IsNull("后门头基价")=False) AndAlso (dr("不并线") = True AndAlso dr("单立线") = True) Then
dr("前立线长") = dr("洞高")
dr("前横线长") = dr("洞宽")
dr.Save() '必须保存一下
msgbox(2)
dr("套线核算单价") = (dr("洞高") * dr("前立线基价") + dr("洞宽") * dr("前门头基价")) * 0.001
dr.Save() '必须保存一下
ElseIf (dr.IsNull("洞高")=False AndAlso dr.IsNull("洞宽")=False) AndAlso (dr.IsNull("前立线基价")=True AndAlso dr.IsNull("前门头基价")=True AndAlso dr.IsNull("后立线基价")=False AndAlso dr.IsNull("后门头基价")=False) AndAlso (dr("不并线") = True AndAlso dr("单立线") = True) Then
dr("后立线长") = dr("洞高")
dr("后横线长") = dr("洞宽")
dr.Save() '必须保存一下
msgbox(3)
dr("套线核算单价") = (dr("洞高") * dr("后立线基价") + dr("洞宽") * dr("后门头基价")) * 0.001
dr.Save() '必须保存一下
……