Microsoft Office Tutorials and References
In Depth Information
Defining the Primary Key
You enter symbols in the Format property in a kind of code:
For This Format
Type This Format Property
Display text all uppercase
> (greater-than sign).
Display text all lowercase
< (less-than sign).
Display text left-aligned
Specify a color
One of the following colors between []
square brackets: black blue green cyan ,
magenta yellow , white .
Book II
Chapter 2
Specify a certain number of
for each required character. (See also @
Chapter 5 of this minibook.)
Specify that no character is
& .
Display predefined text
/text . The Default Value property may
also be useful. Enter /NA to display the text
NA, for example. This property appears in
all records until another value is entered.
Defining the Primary Key
The primary key is a field in each table that uniquely identifies each record
in the field. (Primary keys are described in Book I, Chapter 3, including how
to choose which field or fields to use for your primary key.) The simplest
primary key field is a counter with a value of 1 for the first record, 2 for
the second record, and so on. You can create a counter field by using an
AutoNumber field. If you allow Access to create a primary key for you, it
creates an AutoNumber field.
Another example of a primary key is a Social Security number in a table in
which each record contains information about a single person and each
person is listed only once. Sometimes, each record may be uniquely
identified by the combination of two fields, such as an item number and the
manufacturer. Note that first names and last names may not always be unique!
After you define a field as a primary key, Access prevents you from entering
a new record with the same primary key value. When you’re in doubt, an
AutoNumber field is a good bet for a primary key, but the AutoNumber field
doesn’t allow Access to help you avoid repeating important data as using
another field, as the primary key does.
Follow these steps to create a primary key:
1. Display the table in Design view.
2. Click the row containing the primary key field or select the row by
clicking the record selector.
Search JabSto ::

Custom Search