写在CurrentTableChanged事件中,代码改为:
If CurrentTable.DataTable.Name = "资金" Then
Dim tb As New DropTreeBuilder
tb.SourceTable = DataTables("合同") '指定目录树表
tb.TreeCols = "年份|项目编号|品目编号|拨款序号" '指定用于生成目录树的列
tb.SourceCols = "品目编号|中标供应商|中标金额|拨款序号|拨款比例|拨款金额" '指定数据来源列
tb.ReceiveCols = "品目编号|中标供应商|中标金额|拨款序号|拨款比例|拨款金额" '指定数据接收列
e.Table.Cols("品目编号").DropTree = tb.Build()
End If