增加了单位列后:
Dim pr As DataRow
For Each dr1 As DataRow In DataTables("个人年度汇总").DataRows
If dr1.IsNull("编号") Then
dr1("单位") = Nothing
Else
pr = DataTables("报酬明细").Find("编号 = '" & dr1("编号") & "'", "日期 Desc")
If pr IsNot Nothing Then
dr1("单位") = pr("单位")
Else
dr1("单位") = Nothing
End If
End If
Next
[此贴子已经被作者于2011-11-12 0:16:19编辑过]