If e.DataCol.Name = "比率" Then
If e.NewValue IsNot Nothing Then
Dim dr As DataRow
dr = e.DataTable.Find("货品编号 = '" & e.DataRow("货品编号") & "' And 比率 = " & e.NewValue )
If dr IsNot Nothing Then
MessageBox.Show("比率不能重复!")
e.Cancel = True
End If
End If
End If
[此贴子已经被作者于2011-8-23 21:34:12编辑过]