Dim dr As DataRow dr = DataTables("表A").Find("订单号 = '" & e.Form.Controls("TextBox1").value & "' And [_Identiry] <> " & Table("xxx").Current("_Identify")) If dr IsNot Nothing Then MessageBox.Show("此订单号已经存在!") e.Form.Controls("TextBox1").value = "" End If