以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  给定关键字不在字典中  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=152404)

--  作者:237756360
--  发布时间:2020/7/11 20:51:00
--  给定关键字不在字典中

项目事件

AfterSelRangeChange

 

Dim Str1 As String = ""

Dim t As Table = CurrentTable

 

Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "

Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "

Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "

Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "

Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "

Forms("录入窗体").Strips("状态栏").Items("合计").text= Str1



运行之后报错:

.NET Framework 版本:4.0.30319.42000

Foxtable 版本:2020.5.29.8

错误所在事件:全局表事件,AfterSelRangeChange

详细错误信息:

给定关键字不在字典中。



把错误提示关掉后,功能还好用,还能正常计算。求助蓝板,应该怎么去掉这个错误。


--  作者:237756360
--  发布时间:2020/7/11 21:54:00
--  
已解决!
问题出在全局变量之前没有写生效的条件!导致他在所有有地方都执行代码。
前面加个判断窗口是否打开就行了。完美解决。