No Duplicates Issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a control on a form that won't allow a duplicate to be entered (and it
needs to be that way). I would like an error routine that stops the user's
input and undoes the user's input, along with an error message that indicates
it was a duplicate value. The control is call "Item_No". I know I'm asking
a lot of questions, but I truly don't know the answers.
 
You can trap this in the Form's On Error event. Put in the following code:
If DataErr = 3022 Then
MsgBox "Duplicates not allowed"
Response = acDataErrContinue
Me.Undo
End If

HTH,
Barry
 
Back
Top