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
|
|||
|
|||
Multiple Primary Keys
Hello,
Can I have 2 primary keys where Access requires that they are both not the same. For example... Field1 Field2 a 1 a 2 b 2 Would all be acceptable? Thanks |
#2
|
|||
|
|||
Multiple Primary Keys
Yes,
In table design view, click the frst field, hold down the CTRL key and click the second. They should both be highlighted. Click the "key" icon. To change the properties of your new compound key, or just to see them, go to the View menu and select 'Indexes'. Hope that helps, Rick b "Mike" wrote in message ... Hello, Can I have 2 primary keys where Access requires that they are both not the same. For example... Field1 Field2 a 1 a 2 b 2 Would all be acceptable? Thanks |
#3
|
|||
|
|||
Multiple Primary Keys
Note also that Rick described the *multi-Field* PrimaryKey, not 2 separate
PrimaryKeys. Each Table can only have at most 1 PrimaryKey. HTH Van T. Dinh MVP (Access) "Rick B" wrote in message ... Yes, In table design view, click the frst field, hold down the CTRL key and click the second. They should both be highlighted. Click the "key" icon. To change the properties of your new compound key, or just to see them, go to the View menu and select 'Indexes'. Hope that helps, Rick b |
#4
|
|||
|
|||
Multiple Primary Keys
Shoot, here's what I forgot to explain. I would really
like multiple keys with referential integrity. I should have said that in the original post. My bad. Mike -----Original Message----- Note also that Rick described the *multi-Field* PrimaryKey, not 2 separate PrimaryKeys. Each Table can only have at most 1 PrimaryKey. HTH Van T. Dinh MVP (Access) "Rick B" wrote in message ... Yes, In table design view, click the frst field, hold down the CTRL key and click the second. They should both be highlighted. Click the "key" icon. To change the properties of your new compound key, or just to see them, go to the View menu and select 'Indexes'. Hope that helps, Rick b . |
#5
|
|||
|
|||
Multiple Primary Keys
You can only enforce RI at engine level using the Primary Key.
-- Craig Alexander Morrison wrote in message ... Shoot, here's what I forgot to explain. I would really like multiple keys with referential integrity. I should have said that in the original post. My bad. Mike |
#6
|
|||
|
|||
Multiple Primary Keys
On Mon, 19 Jul 2004 14:56:30 +0100, "Craig Alexander Morrison"
wrote: You can only enforce RI at engine level using the Primary Key. correct... but a Primary Key can consist of one to ten fields. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#7
|
|||
|
|||
Multiple Primary Keys
Yes, but I took the latest answer to mean he wanted to cascade on more than
one index (as opposed to field). Prinary Key is really an Index as opposed to a field. -- Craig Alexander Morrison "John Vinson" wrote in message ... On Mon, 19 Jul 2004 14:56:30 +0100, "Craig Alexander Morrison" wrote: You can only enforce RI at engine level using the Primary Key. correct... but a Primary Key can consist of one to ten fields. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#8
|
|||
|
|||
Multiple Primary Keys
Actually John, I think you can enforce RI at the engine level on any unique
index (simple or compound), it seems to work in both 97 and 2002/2003. Well I never! Apologies for my error in assumption. I've been using various versions of access since 1992, and a wee bit before then - this is the first time I tried it. Mind you I have never needed it. Oooops! Sorry for the misleading information. -- Craig Alexander Morrison "John Vinson" wrote in message ... On Mon, 19 Jul 2004 14:56:30 +0100, "Craig Alexander Morrison" wrote: You can only enforce RI at engine level using the Primary Key. correct... but a Primary Key can consist of one to ten fields. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Primary Key not sorted | Mike | Database Design | 6 | June 16th, 2004 11:11 PM |
Primary Keys | js | New Users | 5 | June 8th, 2004 11:36 PM |
Choosing Primary and Foreign Keys | A.V.H | New Users | 8 | May 23rd, 2004 09:12 PM |
Primary Keys and Relationships | TR | Database Design | 2 | May 23rd, 2004 03:19 AM |
Multiple Conditions and Multiple Solutions | Frank Kabel | Worksheet Functions | 0 | February 4th, 2004 09:22 PM |