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 Keys
I am creating a database where my primary key is a panel number. From there
it breaks down into cells. So it is possible for a panel number to be listed more than once. For example: Panel number: 111111 cell: 1 Panel number: 111111 cell: 2 How could I set up a table/form so that it is possible to have the same panel number? Thanks. |
#2
|
|||
|
|||
Multiple Keys
You can not have multiple keys but you can have a nulti-field key.
Open the table in design view. Click on menu VIEW - Indexes. Add your field in the grid and give the index a name. Then set it as primary in the window below. Then you can have --- Panel number cell 111111 1 111111 2 111111 3 222222 1 222222 2 -- KARL DEWEY Build a little - Test a little "Chinny03" wrote: I am creating a database where my primary key is a panel number. From there it breaks down into cells. So it is possible for a panel number to be listed more than once. For example: Panel number: 111111 cell: 1 Panel number: 111111 cell: 2 How could I set up a table/form so that it is possible to have the same panel number? Thanks. |
#3
|
|||
|
|||
Multiple Keys
On Tue, 29 May 2007 12:46:02 -0700, Chinny03
wrote: I am creating a database where my primary key is a panel number. From there it breaks down into cells. So it is possible for a panel number to be listed more than once. For example: Panel number: 111111 cell: 1 Panel number: 111111 cell: 2 How could I set up a table/form so that it is possible to have the same panel number? Thanks. Your primary key *CANNOT* be the panel number, for this very reason: it's not unique! Instead, select both the panel number field and the cell field in table design view, and click the Key icon. You'll then have a two-field primary key; either the panel number or the cell can repeat, but the combination must be unique. John W. Vinson [MVP] |
#4
|
|||
|
|||
Multiple Keys
I get the concept of a two key Primary key making a unique identifier. Love
that. When I test my database though and put in a record with identical primary key fields, the database throws an errors and freezes up. Putting in records more than once is just the kind of thing that will happen with this database so, can you tell me the elegant way to have the user notified of the error and not freeze up so they can change their entry? -- Thanks "John W. Vinson" wrote: On Tue, 29 May 2007 12:46:02 -0700, Chinny03 wrote: I am creating a database where my primary key is a panel number. From there it breaks down into cells. So it is possible for a panel number to be listed more than once. For example: Panel number: 111111 cell: 1 Panel number: 111111 cell: 2 How could I set up a table/form so that it is possible to have the same panel number? Thanks. Your primary key *CANNOT* be the panel number, for this very reason: it's not unique! Instead, select both the panel number field and the cell field in table design view, and click the Key icon. You'll then have a two-field primary key; either the panel number or the cell can repeat, but the combination must be unique. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|