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次,不知道是什么原因