两段代码在两个表中的表现完全不一样。表1: 运行正常
表2: 生成的数据来自该表第1行,而不是选中的current行
表1代码
With Tables("任务追踪表")
If .Current IsNot Nothing Then
Dim r As Row = .current
.AddNew()
.current("任务主题") = r("任务主题")
.current("责任部门") = r("责任部门")
.current("任务内容") = r("任务内容")
.current("责任部门") = r("责任部门")
.current("执行人") = r("执行人")
.current("关联单号") = r("任务单号")
.current("任务类别") = r("任务类别")
End If
End With
表2代码
Tables("质量成本台账").DataTable.Load(False)
If Tables("质量成本台账").current IsNot Nothing Then
Dim r1 As Row = Tables("质量成本台账").current
Tables("质量成本台账").AddNew()
Dim r As Row = Tables("质量成本台账").current
r("类别") = "索赔供应商"
r("关联单号") = r1("单号")
r("事由") = r1("事由")
End If