A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

3 Field Primary Key



 
 
Thread Tools Display Modes
  #1  
Old January 26th, 2007, 07:21 PM posted to microsoft.public.access.tablesdbdesign
Nanette
external usenet poster
 
Posts: 151
Default 3 Field Primary Key

Is it possible to create a 3 Field Primary Key?

If this is possible, are there any special rules I should be aware of?

If a 3 Field Primary Key is not possible, is there a way to create a
connection between 3 fields so that duplicates are not allowed (comparing the
3 fields), similar to a primary keys function of not allowing duplicates?
  #2  
Old January 26th, 2007, 07:40 PM posted to microsoft.public.access.tablesdbdesign
Jason Lepack
external usenet poster
 
Posts: 600
Default 3 Field Primary Key

On Jan 26, 2:21 pm, Nanette wrote:
Is it possible to create a 3 Field Primary Key?


Yes, click on "View" Indexes. Put the name for the index in the left
column, first row, and the three fields in the right column. To mke it
primary, select that option.

If this is possible, are there any special rules I should be aware of?


The larger your index the longer it will take to perform inserts and
updates but querying should be shorter.

If a 3 Field Primary Key is not possible, is there a way to create a
connection between 3 fields so that duplicates are not allowed (comparing the
3 fields), similar to a primary keys function of not allowing duplicates?


You don't need to make your index primary, just unique.

Cheers,
Jason Lepack

  #3  
Old January 26th, 2007, 07:57 PM posted to microsoft.public.access.tablesdbdesign
George Nicholson
external usenet poster
 
Posts: 791
Default 3 Field Primary Key

- In TableDesign view, ViewIndexes

- Create a new Index with IndexName of Unique (or whatever). Select your
first field under Field Name & Set the Unique property to Yes.

- on the next 2 lines, leave IndexName empty & select your next 2 fields
under Field Name. (Note: leaving IndexName empty is what associates these
fields with Field#1 in the Index).

Done.

You can set this Index to be the Primary Key if you like, but Unique will
probably satisfy the "don't duplicate the combination of these 3 fields"
rule just as well.

If any existing records violate the rule you just set up, Access will let
you know when you try to exit table design. You'll have to find & fix the
violations and then come back & set up your unique index again.

HTH,


"Nanette" wrote in message
...
Is it possible to create a 3 Field Primary Key?

If this is possible, are there any special rules I should be aware of?

If a 3 Field Primary Key is not possible, is there a way to create a
connection between 3 fields so that duplicates are not allowed (comparing
the
3 fields), similar to a primary keys function of not allowing duplicates?



  #4  
Old January 26th, 2007, 08:06 PM posted to microsoft.public.access.tablesdbdesign
RoyVidar
external usenet poster
 
Posts: 417
Default 3 Field Primary Key

"Nanette" wrote in message
:
Is it possible to create a 3 Field Primary Key?

If this is possible, are there any special rules I should be aware
of?

If a 3 Field Primary Key is not possible, is there a way to create a
connection between 3 fields so that duplicates are not allowed
(comparing the 3 fields), similar to a primary keys function of not
allowing duplicates?


Select the fields in question by holding ctrl while clicking the field
selctors (grey buttons to the left of the field). Then hit the primary
key button in the toolbar, alternatively right click to the right of
the field selectors of one of the selected fields, select Primary Key.

--
Roy-Vidar


  #5  
Old January 26th, 2007, 08:21 PM posted to microsoft.public.access.tablesdbdesign
Nanette
external usenet poster
 
Posts: 151
Default 3 Field Primary Key

Thanks everyone!

"RoyVidar" wrote:

"Nanette" wrote in message
:
Is it possible to create a 3 Field Primary Key?

If this is possible, are there any special rules I should be aware
of?

If a 3 Field Primary Key is not possible, is there a way to create a
connection between 3 fields so that duplicates are not allowed
(comparing the 3 fields), similar to a primary keys function of not
allowing duplicates?


Select the fields in question by holding ctrl while clicking the field
selctors (grey buttons to the left of the field). Then hit the primary
key button in the toolbar, alternatively right click to the right of
the field selectors of one of the selected fields, select Primary Key.

--
Roy-Vidar



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.