用datacolchanging事件代替检测
If e.DataCol.Name = "开标时间" AndAlso e.NewValue <> Nothing Then
If e.DataTable.Find("开标时间 = #" & e.NewValue & "# and _Identify <> " & e.DataRow("_Identify")) IsNot Nothing Then
msgbox("开标时间重复")
e.cancel = True
End If
End If
---------------------如果不想焦点离开,validateEdit事件也可以写
If e.Col.Name = "开标时间" AndAlso e.text <> Nothing Then
If e.Table.DataTable.Find("开标时间 = #" & e.text & "# and _Identify <> " & e.Row("_Identify")) IsNot Nothing Then
msgbox("开标时间重复")
e.cancel = True
End If
End If