Select Case e.DataCol.Name
Case "代码"
If e.NewValue > "" Then
Dim dr As DataRow = DataTables("表B").Find(CExp("代码=\'{0}\'",e.NewValue))
If dr Is Nothing Then
For Each r As Row In Tables("字典表").Rows
dr = DataTables("表B").AddNew
dr("编号") = r("编号")
dr("名称") = r("名称")
Next
DataTables("表B").Save
End If
End If
End Select