• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Modifying Your Table Design > Changing the Primary Key

Changing the Primary Key

Chapter 3, “Designing Your Database Application,” discussed the need to have one or more fields that provide a unique value to every row in your table. This field or group of fields with unique values is identified as the primary key. If a table doesn’t have a primary key, you can’t define a relationship between it and other tables, and Microsoft Access has to guess how to link tables for you. Even if you define a primary key in your initial design, you might discover later that it doesn’t actually contain unique values. In that case, you might have to define a new field or fields to be the primary key.

Let’s go back to the three tables we built earlier with the Table Analyzer Wizard. Suppose you discover that users are becoming confused by the fact that ContactTypes_ID is a number instead of the actual text. (See my comments about using the Lookup Table Wizard in the previous section.) You could keep the lookup table to help avoid duplicate values, but there’s no reason not to store the actual text value in the Contacts table instead of a linking ID.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint