Error message on data entry

  • Thread starter Thread starter Corinne
  • Start date Start date
C

Corinne

The form I have made for data entry is working fine for the majority of my
records but occasionally I get a message when I try to enter some data on an
existing record. The message is

'The changes you requestd to the table were not successful because they
woudl create duplicate values in the index, primary key, or relationship.
Change the dat in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit dupilcate entries and try again.'

Strangely this message only appears on a few of the records and I have been
entering data in the same fields for all the records with no problems with
the majority. Once I get this message I can't get out of the record to move
on to another record unless I close the form and start again

Could anybody shed some light on why this may be happening?

Many Thanks
 
The table in question has a "primary key", and/or, a "unique index" on one
or more fields. You are never allowed to enter two records with the same
value of the primary key, or of the field(s) defined in the unique index.
That's part of the >purpose< of having a primary key or unique index. >Every
table< in a properly designed database, should have a primary key.
Therefore, you will >always< get this message, if you try to add a
"duplicate record".

In other words: "works as designed"!

If you don't like the message - who does - you can replace it with one of
your own. Check out the form level Error event in online help.

HTH,
TC
 
I can understand about the primary key stuff, and all my tables have an
autonumber primary key. As far as I am aware I have never set a unique index
anywhere, as I wouldn't know how.
So I don't know what has gone wrong, as it was only a few records I could
delete them and re-enter the data and now all is well. But thanks for your
help, Access seems to have a mind of its own sometimes, and does bizarre
things for no particular reason that I can fathom.
 
Ok, I spoke a bit below your level. I wondered about that, when I re-read my
answer after sending it.

Various people have posted problems to do with autonumbers repeating
themselves. Could it be that?

I don't have Access here to check, but I believe you can say that an
autonumber should be >random<, no? If that's what you've done, perhaps the
random value sometimes repeats itself. (Random does not necessarily mean
unique, afaik.)

Cheers,
TC
 
Back
Top