仿右下角计算:
If Forms("窗口1").Opened Then
Dim Sum,Average,Count As Double
With CurrentTable
Sum = CurrentTable.Aggregate(AggregateEnum.Sum, .TopRow, .LeftCol, .BottomRow, .RightCol)
Average = CurrentTable.Aggregate(AggregateEnum.Average, .TopRow, .LeftCol, .BottomRow, .RightCol)
Count = CurrentTable.Aggregate(AggregateEnum.Count, .TopRow, .LeftCol, .BottomRow, .RightCol)
End With
Forms("窗口1").Controls("Label1").text =" 累计:" & Cstr(sum) & " 平均:" & Cstr(Average) & " 计数:" & Cstr(Count) & " "
End If
表事件: AfterSelRangeChange