我的代码里有大约10组这种汇总的代码,很可能一次全部触发,数据量一大,大约30行左右,大约3-4个层级,就会卡死,请问怎么解决。
If e.DataCol.Name = "净重" OrElse e.DataCol.Name ="数量" OrElse e.DataCol.Name ="层级" Then
Dim wz As Integer
For wz = 0 To Tables("表A").Rows.count-1
Dim t1 As Table = Tables("表A")
Dim a1 As String = t1.Rows(wz)("层级")&"."
Dim a2 As Integer = t1.Rows(wz)("级别")+1
If DataTables("表A").Compute("count(层级)","物料信息_层级 like '" & a1 & "%' and 级别= '" & a2 & "' ") > 0 Then
t1.Rows(wz)("净重")= DataTables("表A").compute("Sum(净重辅助)","层级 like '" & a1 & "%' and 级别= '" & a2 & "' ")
End If
Next
End If
此主题相关图片如下:捕获2312.jpg
[此贴子已经被作者于2021/10/11 9:33:19编辑过]