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

A

Alistair

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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top