Results 1 to 3 of 3

Thread: Key Fields (2k)

  1. #1
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Key Fields (2k)

    I have an excel list with 35 fields. 5 of these fields are used to create uniqueness in the entries, DN, DT, RC, ACD, and OS. All of these fields have values in them EXCEPT for RC. RC can be blank, and it being blank is one way it helps create the uniqueness (it stands for rev code, and if theres no rev code, its a first copy, therefore unique). In my access table I tried to define those 5 fields as primary keys, to prevent doubles from being entered. My list has about 4500 entries, and 3900 of them have blank rev codes. When i import the file, i get 600 entries. its obviously the blank rev codes that it is not being allowed to be imported into the table.

    So my question is: can i use a field that can contain NO value as a primary key to help define uniqueness? or is there another way i should be going about doing this?
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Key Fields (2k)

    A primary key cannot contain null (blank) values in any of its fields. From the online help:
    <hr>Once you designate a primary key for a table, Access will prevent any duplicate or Null values from being entered in the primary key fields.<hr>
    You will have to replace the blanks in the RC column in the Excel table by a non-blank value that stands for 'first copy'. Perhaps 0 would be appropriate, but that's up to you to decide. You should then be able to import all entries.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Key Fields (2k)

    yeah i figured that would be the answer, but i was hoping access could do it. thanks hans
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •