Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
DataColChanged
表事件中执行,看看结果对不?狐狸爸爸 这个答案很给力,Foxtable强悍!谢谢!
Select Case e.DataCol.name
Case "客户"
Dim dr As DataRow = DataTables("客户报价").Find("客户 = '" & e.DataRow("客户") & "'")
If dr IsNot Nothing Then
e.DataRow("报价") = dr("报价")
End If
End Select
Select Case e.DataCol.name
Case "客户","公式","长","宽","高"
Dim dr As DataRow = DataTables("公式").Find("公式名称 = '" & e.DataRow("公式") & "'")
If dr IsNot Nothing Then
e.DataRow("金额") = Eval(dr("计算公式"),e.DataRow)
End If
End Select
Select Case e.DataCol.Name Case "客户","公式" If e.DataRow.IsNull("客户") Or e.DataRow.IsNull("公式") Then e.DataRow("产品单价")=Nothing Else Dim dr As DataRow dr=DataTables("客户报价").Find("客户='" & e.DataRow("客户") & "'") If dr IsNot Nothing Then Dim r As DataRow = e.DataRow If r("公式")="公式1" Then r("产品单价")=((r("长")+r("宽"))*(r("宽")+r("高"))*dr("报价"))/1000 Else r("产品单价")=(((r("长")+2)*(r("宽")+1))*((r("宽")+2)*(r("高")+1)))*dr("报价")/1000 End If End If End If End Select |
foxtable很强,顶