以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  dataclochanged  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=131978)

--  作者:刘林
--  发布时间:2019/3/10 21:36:00
--  dataclochanged
Select e.DataCol.name
    Case "B2","B17","B47","B68","B69","B70"
        e.DataRow("B0")= e.DataRow("B2")+e.DataRow("B17")+ e.DataRow("B47")+ e.DataRow("B68")+ e.DataRow("B69")+ e.DataRow("B70")
    Case "B3","B10"
        e.DataRow("B1")=e.DataRow("B3")+e.DataRow("B10")
    Case "B4","B11"
        e.DataRow("B2")=e.DataRow("B4")+e.DataRow("B11")
    Case "B4","B7"
        e.DataRow("B3")=e.DataRow("B4")+e.DataRow("B7")
    Case "B11","B15"
        e.DataRow("B10")=e.DataRow("B11")+e.DataRow("B15")      
    Case "B18","B19","B32"
        e.DataRow("B16")=e.DataRow("B18")+e.DataRow("B19")+e.DataRow("B32")
    Case "B20","B21","B33"
        e.DataRow("B17")=e.DataRow("B20")+e.DataRow("B21")+e.DataRow("B33")
    Case "B20","B26"
        e.DataRow("B18")=e.DataRow("B20")+e.DataRow("B26")
    Case "B21","B27"
        e.DataRow("B19")=e.DataRow("B21")+e.DataRow("B27")
    Case "B33","B38"
        e.DataRow("B32")=e.DataRow("B33")+e.DataRow("B38")
    Case "B34","B35","B36","B37"
        e.DataRow("B33")=e.DataRow("B34")+e.DataRow("B35")+e.DataRow("B36")+e.DataRow("B37")
    Case "B39","B40","B41","B42"
        e.DataRow("B38")=e.DataRow("B39")+e.DataRow("B40")+e.DataRow("B41")+e.DataRow("B42")
    Case "B46","B50","B58"
        e.DataRow("B44")=e.DataRow("B46")+e.DataRow("B50")+e.DataRow("B58")
    Case "B47","B51","B59"
        e.DataRow("B45")=e.DataRow("B47")+e.DataRow("B51")+e.DataRow("B59")
    Case "B47","B49"
        e.DataRow("B46")=e.DataRow("B47")+e.DataRow("B49")
    Case "B51","B53"
        e.DataRow("B50")=e.DataRow("B51")+e.DataRow("B53")
    Case "B59","B65"
        e.DataRow("B58")=e.DataRow("B59")+e.DataRow("B65")
  Case "学校名称"
        Dim dr As DataRow = DataTables("学校信息").find("单位全称=\'" & e.DataRow("学校名称") & "\'")
        If dr IsNot Nothing
            e.DataRow("所属中心校") = dr("所属中心校")
        End If

        
End Select
老师,请问红色代码中,为什么B11输入数字B10不能改变,但B15输入数字B10能求出B11+B15,是什么原因

--  作者:有点甜
--  发布时间:2019/3/10 21:41:00
--  

不能重复,重复的时候,需要写多个 select end select

 

Select e.DataCol.name
    Case "B2","B17","B47","B68","B69","B70"
        e.DataRow("B0")= e.DataRow("B2")+e.DataRow("B17")+ e.DataRow("B47")+ e.DataRow("B68")+ e.DataRow("B69")+ e.DataRow("B70")
    Case "B3","B10"
        e.DataRow("B1")=e.DataRow("B3")+e.DataRow("B10")
    Case "B4","B11"
        e.DataRow("B2")=e.DataRow("B4")+e.DataRow("B11")
    Case "B4","B7"
        e.DataRow("B3")=e.DataRow("B4")+e.DataRow("B7")
    Case "B11","B15"
        e.DataRow("B10")=e.DataRow("B11")+e.DataRow("B15")