Select e.DataCol.name Case "客户全称" Dim dr0 As DataRow dr0 = DataTables("客户信息表").find("客户全称 = '" & e.newvalue & "'") If dr0 IsNot Nothing Then e.cancel = True messagebox.show("已有该客户,请直接选择!","提示") End If Case "客户名称" Dim dr0 As DataRow dr0 = DataTables("客户信息表").find("客户名称 = '" & e.DataRow("客户名称") & "'") If dr0 IsNot Nothing Then messagebox.show("已有该客户,请直接选择!","提示") End If End Select