Multiple Primary Keys

G

Guest

When I have two primary keys on my table, when the table is shown, the
"field" area for the first key is nowhere near big enough. Both fields are
set to a size of 50 characters; one is a SSN (1st field, 11 characters), and
the other is a date (2nd field, 10 characters). Why can't I just adjust the
size of the first field like I can a column?
 
R

Rick B

First, I don't think you can have two primary keys on one table. You can
have two keys, but only one can be a primary key. I believe you can include
two fields in one index and make that the primary key, but I have not tried
it.

You should be able to adjust the size of the columns when you open a table
and view the contents, but... You generally should not be viewing the
contents of your tables in the table object. Once you design your table and
get it right, you should do all your work in the forms, queries, and
reports. Tables are buckets to hold your data - they are not designed to be
your interfaces to add, change, and retrieve your data.
 
J

John Vinson

On Thu, 13 Oct 2005 11:09:04 -0700, "Liz Gronewold" <Liz
When I have two primary keys on my table,

No, you don't. <Highlander>There can only be one!</Highlander> A table
can have one and only one primary key; that key might consist of one,
two, or ten fields, but it's only the one key.
when the table is shown, the
"field" area for the first key is nowhere near big enough.

In the table datasheet?? Two suggestions: one, use the mouse, click at
the right edge of the field that's too small, drag it right, and save
the table; and - better - don't use table datasheets for any routine
viewing or editing; use a Form instead.
Both fields are
set to a size of 50 characters; one is a SSN (1st field, 11 characters),

so why are you allocating 50 characters if you'll never have more than
11?
and the other is a date (2nd field, 10 characters).

If it's a Date/Time field, it's not actually stored as characters;
it's stored as a number, formatted to look like a date.
Why can't I just adjust the
size of the first field like I can a column?

I'm not at all sure what it is you're trying to "adjust".

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

2 primary keys 3
Primary Keys 5
Multiple Field Primary Key 1
Primary Key Cascade Question 5
Can't assign primary key 3
Long Integer field size 11
Help - Primary key questions 13
Primary key 1

Top