因数据行较多,为了直观添加数据,清空表数据再添加,结果新增的也清了,如何是好??用remove吗?
Dim tb1 As Table=Tables("排车排工_Table1")
Dim tb2 As Table=Tables("排车排工_Table2")
If tb1.Current IsNot Nothing Then
If tb1.Current.DataRow.RowState=DataRowState.Added OrElse tb1.Current.DataRow.RowState=DataRowState.Modified Then
Else
tb1.Current.Locked = True '锁定行,防止添加过程中修改主表数据
tb2.Filter="_Identify is null" '清空明细表,便于操作
Dim r As Row= tb2.AddNew()
r("结算编号")=tb1.Current("编号")
r("用车单位")=tb1.Current("用车单位")
r("二级单位或地点")=tb1.Current("二级单位")
r("年份")=tb1.Current("年份")
r("月份")=tb1.Current("月份")
End If
Else
End If