把副本改为sqltable就简单得多了,直接使用AppendLoad追载新数据即可,然后正本使用removefor移除。
副本就麻烦多了,每次都获取副本的所有行的主键,然后合并双击正本某行的主键,作为筛选条件使用;
双击事件
Dim ids As String
For Each dr As DataRow In Tables("副本").DataRows
ids = ids & "," & dr("订单ID")
Next
ids= ids.Trim(",") &"," & e.row("订单ID")
Tables("副本").filter = "订单ID in ("ids")"
Tables("正本").filter = "订单ID not in ("ids")"