Duplicate values prevent adding new records

K

Kevin

Hi all,

I have a form which displays summarized information on Mission Reports in a
number of textboxes. The textboxes are locked. In order to edit the
information for a given report, I have created another form (for editing and
adding new records)with identical textboxes which is opened by a command
button. when I click on the new record button and attempt to add new
information for a second Mission report and then close the form, I get a
message saying: "The changes you requested to the table were not successful
because they would create duplicate values in the index, primary key or
relationship..."
My main form and my form for editing display information according to
country. Both have the same underlying table (Table 1) where countries and
their country codes are listed alphabetically. The primary key is "country".
The two forms are filtered.
My question is what do i need to do to be able to add new records in the
Edit form without creating duplicate values? I have attempted changing the
primary key in Table 1 to code or region for example but to no effect.

Would appreciate any help.
 
B

Brian

The error message has to do with the value of the key field of the new
record, it is the same as one that is already there. From your last comment
it sounds that your table design is bad. If it is possible that two records
can have the same value in a field, that field cannot be a primary key. If
it is all the fields can be duplicated then it means that you don't really
need a primary key - they can be indexed but not primary. If you still want
a primary key you can add a new field called say, ID, and make it autonumber
which will always be unique.
Brian
 

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