new user with primary key issues

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
In bank customers, is Customer ID an Autonumber as well as being a primary key?

It should be! Hope that helps.
 
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
 
th0r0n said:
In bank customers, is Customer ID an Autonumber as well as being a primary key?

It should be! >

I do hope my bank doesn't follow your advice. I trust they choose a
better algorithm for generating key values than a random/incrementing
numeric e.g. a fixed length string incorporating a check-digit would
help reduce keying errors that result in my money being paid into
someone else's account etc.

Jamie.

--
 
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
 
th0r0n said:
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

Oh, sorry, so what *was* your point when you suggested using an
autonumber?

Jamie.

--
 
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."
 
Back
Top