If e.DataCol.Name = "订单号" Then
Dim dr As DataRow
Dim dr1 As DataRow
dr = DataTables("表A").Find("订单号 = '" & e.NewValue & "'")
dr1 = DataTables("表B").Find("订单号 = '" & e.NewValue & "'")
If dr IsNot Nothing Or dr1 IsNot Nothing Then
MessageBox.Show("此订单号已经存在!")
e.Cancel = True
End If
End If