Re: Multiple Primary Keys

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Thu, 13 Oct 2005 11:09:04 -0700, "Liz Gronewold" <Liz
Gronewold@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>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]
.



Relevant Pages

  • RE: Should be a simple question
    ... problem with Datasheet View ... If you start a record and then cancel it, your number is lost. ... fields for the Primary Keys of tables (of which you store that ID number in ... Tutorials at http://www.btabdevelopment.com ...
    (microsoft.public.access.gettingstarted)
  • Re: Char or varchar for a primary key?
    ... The requirement is that primary keys must be "natural"; ... Customers the primary key will be a max. 10 characters string (but the ... at least if your default collation is a Windows collation. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Multiple Primary Keys
    ... I don't think you can have two primary keys on one table. ... You should be able to adjust the size of the columns when you open a table ... Once you design your table and ... your interfaces to add, change, and retrieve your data. ...
    (microsoft.public.access.gettingstarted)
  • Re: Record Limit in a datasheet?
    ... There are two tables in the query and both have primary keys. ... adding records to my datasheet and it would not allow me to do so. ... makes me think I've run up against a record limit. ...
    (microsoft.public.access.forms)