我把那个checkbox删掉了,然后在主档datacolchanged那里写代码:(“按体积平摊”是逻辑型)请问怎么修改才正确 Select e.DataCol.name Case "目的港","装箱方式","价格条款","总体积","按体积平摊运费" Dim yf As DataRow = DataTables("运费价格").Find("港口名 = '" & e.DataRow("目的港") & "' and 装箱方式 = '" & e.DataRow("装箱方式") & "' and 价格条款 = '" & e.DataRow("价格条款") & "'") If yf IsNot Nothing AndAlso e.DataRow("按体积平摊运费") = True AndAlso e.DataRow("总体积") > 0 Then Then For Each a As DataRow In DataTables("报价明细").Rows If a("QTY") IsNot Nothing Then a("运费") = (a("总体积")/e.DataRow("总体积") *( e.DataRow("总体积") * yf("费用1") + yf("费用2")))/a("QTY") End If Next End If If e.DataRow("按体积平摊运费") = False AndAlso e.DataRow("总体积") > 0 For Each a As DataRow In DataTables("报价明细").Rows If a("QTY") IsNot Nothing Then a("运费") = (a("总体积") * yf("费用1") + yf("费用2"))/a("QTY") End If Next End If End Select
|