If MainTable.Name = "采购动态分析" Then
Dim f As New Filler
DataTables("采购动态分析").DataRows.Clear() \'清除原有数据
f.SourceTable = DataTables("入库明细")
f.SourceCols = "供应商_名称"
f.DataTable = DataTables("采购动态分析")
f.DataCols = "客户"
f.Fill()
DataTables("采购动态分析").DataCols("采购_数量").Recalc()
End If
这是表事件
Dim ck As DataRow = e.DataRow
Dim xs As DataTable = DataTables("入库明细")
If e.DataCol.Name = "客户" Then
ck("采购_数量") = xs.Compute("Sum(入库_数量)","[供应商_名称] = \'" & ck("客户") & "\'")
ck("采购_金额") = xs.Compute("Sum(金额合计)","[供应商_名称] = \'" & ck("客户") & "\'")
End If