以文本方式查看主题

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

--  作者:kaituozhe
--  发布时间:2020/2/9 15:44:00
--  Select使用

Dim filter7 As String = "会计科目编码 = \'" & e.DataRow("会计科目编码") & "\'and  账面会计科目编码 = \'" & e.DataRow("账面会计科目编码") & "\'and 日期 >= \'" & e.DataRow("开始日期") & "\'and 日期 <= \'" & e.DataRow("截止日期") & "\'and 公司名称 = \'" & e.DataRow("公司名称") & "\'"
Dim st As Date = Date.Now \'将开始时间保存在变量st中
Select Case e.DataCol.name
    Case "会计科目编码"
        msgbox(0)
        If e.DataRow.Isnull("会计科目编码") = False  Then
            msgbox(11)
            e.DataRow("科目编号") = e.DataRow("会计科目编码").SubString(0,e.DataRow("会计科目编码").IndexOf("_"))
            Dim bh() As String = (e.DataRow("会计科目编码").SubString(e.DataRow("会计科目编码").IndexOf("_")+1,e.DataRow("会计科目编码").Length - e.DataRow("会计科目编码").IndexOf("_")-1)).split(".")
            e.DataRow("项目编号") = bh(0)
            msgbox(12)
            msgbox(e.DataRow("科目编号") )
            msgbox(e.DataRow("项目编号"))
        Else
            e.DataRow("科目编号") = Nothing
            e.DataRow("项目编号") = Nothing
        End If
        msgbox(1)End Select
msgbox(8)
MessageBox.Show("耗时: " & (Date.Now - st).TotalSeconds & "秒") \'计算并显示执行代码所花费的秒数
msgbox(7)


  "会计科目编码"发生一次变动,上述代码会执行4次,不知道是什么原因     


--  作者:有点蓝
--  发布时间:2020/2/9 22:38:00
--  
应该是2个编号赋值后触发了其它的代码,其它代码反过来有影响到这个事件