Cant update table

J

Johan

When I add a second record into tblSoftwarePackages, I get
a dialog box that say, "The changes you made in the table
were not successful because they would create duplicate
values in the index, primary key or relationship. Change
the data in the field or fields that contain duplicate
data, remove the index, or redefine the index to permit
duplicate entries and try again."

I don't know exactly what the problem can be.

I appreciate your advise

Johan
 
T

Tim Ferguson

When I add a second record into tblSoftwarePackages, I get
a dialog box that say, "The changes you made in the table
were not successful because they would create duplicate
values in the index, primary key or relationship.

My guess is that the primary key is based on an integer (or long int)
field, and the default value gets set to zero by default (the default
default value...), and you've forgotten to put in a new value for the
second record.

Plan: in table design, clear the DefaultValue for the field altogether. In
that way, when you forget to enter the new value in the form, you'll get a
"Field cannot be empty" error, which is the correct message;

decide some method for allocating new PK values (consecutives, read them
from a book, etc etc);

if the method can be programmed, code it into the BeforeUpdate event behind
the data entry form.

Hope that helps


Tim F
 

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