Results 1 to 3 of 3
  1. #1
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69

    Question having trouble setting composit primary key

    Hi,
    I am trying to set a primary key on two fields. the problem is that the one field is null for some records. they will eventualy fill them in. However, because it is null now it will nowt let me set it as a primary key. I tryed setting the feild, in the properties, with a default value; but it would not tkae it. Any ideas would be reall appreciated.
    thank you
    itm

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    A composite primary key can never contain Null values in any part of it - so you cannot do what you are trying. This make sense - because a primary key must be unique, allowing part of a composite PK to be null would lead to problems with duplicate values.

    A default value in the field properties only specifies the value that the field will have when new records are entered - it has no effect on existing records.

    John

  3. #3
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Thank you I was hoping that there was a was y to put a default vaule in, but I quess not .
    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 10-03-2011, 02:46 PM
  2. UI Macro Trouble
    By beetgirl in forum Access
    Replies: 0
    Last Post: 07-06-2011, 10:17 AM
  3. Trouble with (R)
    By NOTLguy in forum Access
    Replies: 3
    Last Post: 10-29-2010, 11:55 AM
  4. Iff trouble
    By JackT in forum Access
    Replies: 3
    Last Post: 08-18-2010, 02:28 PM
  5. Trouble with Query
    By jbarrum in forum Access
    Replies: 1
    Last Post: 01-13-2010, 04:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums