参考:
http://www.foxtable.com/webhelp/topics/1451.htm
"GZFFB"datacolchanged事件
If e.DataCol.Name = "工号" Then
Dim nms() As String = {"时段","ID","......}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("考勤表").Find("[工号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
"考勤表"的datacolchanged事件
Select Case e.DataCol.Name
Case "时段","ID","......
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
Dim filter As String
filter = "工号 = '" & dr("工号") & "'"
pr = DataTables("GZFFB").Find(filter)
If pr Is Nothing Then
pr = DataTables("GZFFB").addnew
pr("工号") = dr("工号")
End If
pr(e.DataCol.Name) = dr(e.DataCol.Name)
End Select