我要的不是禁止重复,而是目录树中没有的字节名称(即巷表巷列中没有的字符)不允许输入,因此帮助里的
Select Case e.DataCol.name
Case "型号","规格"
Dim dr As DataRow = e.DataRow
If dr.IsNull("型号") = False AndAlso dr.IsNull("规格") = False Then
If e.DataTable.Compute("Count([_Identify])","型号 = '" & dr("型号") & "' And 规格 = '" & dr("规格") & "'") > 1 Then
MessageBox.Show("已经存在相同型号和规格的行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.DataRow(e.DataCol.Name) = e.OldValue '取消输入
End If
End If
End Select
不成立!
[此贴子已经被作者于2021/1/25 23:04:02编辑过]