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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|