加一个任务,名称为“统计什么什么”。
Select Case e.link.text
Case "录入配件出库单"
Forms("录入配件销售出库单").Open() '打开窗口的方法
Case "配件出库表"
MainTable = Tables("配件销售出库单") '打开相应的表的方法
Case "统计什么什么"
Dim t As Table = Tables("配件销售出库明细")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "订单号"
g.TotalOn = "订单数量"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
g.TotalOn = "订单数量"
g.Caption = "总计"
g.upto = True
t.SubtotalGroups.Add(g)
t.Subtotal()
End Select