Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't add primary field

Status
Not open for further replies.

BigGip

Technical User
Aug 1, 2001
1
AU
Hi,
I need some help! I am setting up a database, and I am new to Access (maybe, I am also an idiot). I have setup up a table and pasted some info from excell into it. It now won't let me set a field to primary key. It says "the changes were not successful because they would create duplicate values in the index, primary key or relationship, blah blah" there is no duplicates in the field and i haven't setup the index yet.
cheers in advance,
Big-Gip from the SWATS
 

It appears you need to examine the data more closely. Access is tellig you that data is duplicated at least once. Use the Find Duplicates Query Wizard to create a query that will show you the duplicates. Or try a simple query to find duplicates.

Select FieldName, Count(*) AS RecCnt
From Tbl
Group By FiledName Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 

I forgot one part of the query.

Select FieldName, Count(*) AS RecCnt
From Tbl
Group By FiledName
Having Count(*) > 1 Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Make sure that there are no blanks in the field you are trying to set as primary as well. Multiple blanks would cause that error.

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top