在订单表设置DataColchanging事件:
if e.DataCol.Name = "商品条码" Then
Dim tm As String = e.NewValue
If tm > "" Then
If DataTables("商品表").Find("商品条码 = '" & tm & "'") Is Nothing Then
MessageBox.show("输入的条码不存在!")
e.Cancel = True
End If