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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null Value and Primary Key

Status
Not open for further replies.

DavidDF

MIS
Jan 19, 2003
8
US
I am using an Append Query to add records to a table. I have set three fields in the target table as the Primary Key: first,init & last. If there is always a value in at least one of the fields then the Primary Key is never a null. Access 2003, however, does not seem to see it this way. Does there always have to be a non-null in all three fields? If I leave out the init or middle name field there will be many more duplicates.

David
 
Hi David!

Go into design view for the table and check each field's properties. Make sure Required is set to No.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Primary Key fields don't allow nulls. One way to get around that is to create a default value of an empty string "" for each field. Another option is to make something like the social security number as the primary key or to combine first and last name with some other field as the composite key.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top