If Tables("员工导入_员工列表").Rows.Count>0 Then
For Each r1 As Row In Tables("员工导入_员工列表").GetCheckedRows
Dim idx As Integer = Tables("考勤主表.考勤明细表").FindRow("员工编号 = '" & r1("员工编号") & "'")
If idx < 0 Then
Dim r2 As Row = Tables("考勤主表.考勤明细表").addnew
r2("员工编号")=r1("员工编号")
r2("姓名")=r1("姓名")
End If
Next
Tables("考勤主表.考勤明细表").Select(-1,0)
e.Form.Close
Else
MessageBox.Show("没有可以添加的员工")
End If
[此贴子已经被作者于2017/11/5 21:36:11编辑过]