Private Sub 报价单流水号_BeforeUpdate(Cancel As Integer)
If IsNull(DLookup("报价单流水号", "报价单表", "报价单流水号='" & Me![报价单流水号] & "'")) = False Then
MsgBox "报价单流水号为 " & 报价单流水号 & " 已经有记录了,请重新输入正确的报价单流水号!", 48, "重复提醒"
Me.报价单流水号 = Null
Me.报价单流水号.SetFocus
End If
End Sub
自己想到一个愚蠢的办法,就是重复的时候,不保存数据,重新输入
Private Sub 报价单流水号_BeforeUpdate(Cancel As Integer)
If IsNull(DLookup("报价单流水号", "报价单表", "报价单流水号='" & Me![报价单流水号] & "'")) = False Then
MsgBox "报价单流水号为 " & 报价单流水号 & " 已经有记录了,请重新输入正确的报价单流水号!", 48, "重复提醒"
me.undo
End If
End Sub