表B的DataColChanged
If e.DataCol.Name = "电话号码" Then
Dim dr As DataRow = DataTables("表A").Find("车号 = '" & e.DataRow("车号") & "' And 电话号码 Is Null")
If dr IsNot Nothing Then
dr("电话号码") = e.DataRow("电话号码")
End If
End If
按钮代码:
For Each r As Row In Tables("表A").Rows
For Each r1 As Row In Tables("表B").Rows
If r("车号") = r1("车号") AndAlso r("电话号码") = "" Then
r("电话号码") = r1("电话号码")
End If
Next
Next
[此贴子已经被作者于2013-6-4 12:49:59编辑过]