adding primary key to table

  • Thread starter Thread starter harvey
  • Start date Start date
H

harvey

I want to add a primary key to an existing table. After
creating id field, no duplicates,whole number, and setting
id value to primary, I get error messages preventing me
from creating value. Solutions or explanations would be
appreciated for access 2000 user.
 
First purge whatever duplicates you may have with the Find Duplicates query
wizard. Then add an autonumber to your table save the table then add the
index Primary Key to the autonumber field that you just added. That's it.

There are other ways, but that is the easiest.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
I want to add a primary key to an existing table. After
creating id field, no duplicates,whole number, and setting
id value to primary, I get error messages preventing me
from creating value. Solutions or explanations would be
appreciated for access 2000 user.

How are you filling this field? Does it have any values at all (or is
it using the default value of 0)?

Just specifying that a field doesn't *permit* duplicates won't fill it
with values that don't *have* duplicates!
 
Back
Top