new user with primary key issues

B

blubroth

I'm a brand new access user (2003) trying to follow the tutorial at
cisnet.baruch.cuny.edu/holowczak.... When creating the sample tables (bank
customers and bank accounts) I set the customer ID # as a primary key. Now,
when I go to enter account information for customers that have both savings
and checking accounts, I get the following error message "The changes you
requested to 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." What am I
doing wrong?
 
T

th0r0n

In bank customers, is Customer ID an Autonumber as well as being a primary key?

It should be! Hope that helps.
 
E

Ed Warren

you need a
tableCustomers with customerID as a key field

you need a

tableAccounts
with accountId as a key field
customerID as a foreign key
typeaccount (saving/checking)

relationship to model:

Each customer has many accounts (1:M) Account (M) <----- (1) Customer on
CustomerID

Ed Warren
 
T

th0r0n

Oh,

Sorry,

I didn't realise he was coding the backend for Lloyds, rather than following
a tutorial which is there to illustrate a point, not be secure

:p
 
T

th0r0n

my point was that not setting the primary key field to an autonumber
sometimes results in this error:

"The changes you
requested to 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."
 
Top