Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / July 2007

Tip: Looking for answers? Try searching our database.

Multiple Keys

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chinny03 - 29 May 2007 20:46 GMT
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.
KARL DEWEY - 29 May 2007 21:30 GMT
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

Signature

KARL DEWEY
Build a little - Test a little

> 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
[quoted text clipped - 8 lines]
> How could I set up a table/form so that it is possible to have the same
> panel number?  Thanks.
John W. Vinson - 29 May 2007 21:54 GMT
>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
[quoted text clipped - 8 lines]
>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]
knowshowrosegrows - 31 Jul 2007 17:42 GMT
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?
Signature

Thanks

> >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
[quoted text clipped - 17 lines]
>
>              John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.