how do I prevent a duplicate value being entered in a form field

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

Guest

I want to ensure that users entering data in a form cannot enter duplicate
values in records and have an error message automatically displayed. The
table design for that field is set to no duplicates and required and displays
a message to the user indicating a duplicate record value has been entered
when you try to save, but no message is displayed in the form although the
duplicate record is not saved. This results in confusion, wasted time and the
fact that the whole record has not been saved is not discovered at the time,
any ideas?
Alistair
 
The message should be displayed in the form unless:
a) The form is closed with DoCmd.Close.
There is a serious data-loss bug with this method.
Details:
http://allenbrowne.com/bug-01.html

or
b) You are suppressing the error message in the Error event of the form.
 
Back
Top