>I have the following code in a from where user is to enter New Ingredient.
>It catches the error when a duplicate Ingredient ID is used. It works so
[quoted text clipped - 18 lines]
>
>End Sub
Thank you so much. I thought there would be an easy solution.
Though, to clear the record I used
Cancel=True
Me.Undo
(when I just used Me.IngredientID.Undo I got a further error message)
Penny
> >I have the following code in a from where user is to enter New Ingredient.
> >It catches the error when a duplicate Ingredient ID is used. It works so
[quoted text clipped - 23 lines]
> Cancel = True
> Me.IngredientID.Undo
Marshall Barton - 07 Jul 2007 15:51 GMT
Glad to able to help.
If the ingredient is essentially the record, then, yes, you
want to undo the whole record.

Signature
Marsh
MVP [MS Access]
>Thank you so much. I thought there would be an easy solution.
>
[quoted text clipped - 30 lines]
>> Cancel = True
>> Me.IngredientID.Undo