表B,DataColChanged事件
If e.DataCol.Name = "编号" AndAlso e.NewValue > "" Then If e.DataRow.GetParentRow("表A") Is Nothing Then msgbox("父表没有数据") End If End If