Primary key (autonumber)?

K

keith Bemis

I have used the primary autonumber as the primary key on
my database and on all the subforms (6 all together )
I have used that as the link orkey for each ,,is that the
correct method?
thanks
keith bemis
 
R

Roger Carlson

Holy Wars have started over this question <grin>, but I think it is
generally accepted that an autonumber primay key is the preferred method.
Of course, you don't want to link the autonumber primary key of the mainform
to the autonumber primary key of the subform. (Your question COULD be
interpreted that way). The subform table should have a Long Integer field
which links to the primary key of the mainform. (That is in addition to the
subform having its own autonumber primary key.)
 
A

anonymousAutoNbr

I have seen samples of PK AutoNbr to PK AutoNbr between
tables, then uses as forms and sub forms. Is there a
problem with such a setup???

TIA
 
J

John Vinson

I have seen samples of PK AutoNbr to PK AutoNbr between
tables, then uses as forms and sub forms. Is there a
problem with such a setup???

Yes. IT WON'T WORK.

For one thing, you cannot assign an Autonumber as a foreign key; for a
second, you cannot update an Autonumber field, so having it as the
Child Link Field of a subform will not work; but most importantly, an
Autonumber IS ARBITRARY. If you *could* link them, it would link each
record of your "parent" table to an unpredictable and uncontrollable
record of your "child" table... not particularly useful!
 
A

anonymousAutoNbr

Thanks. I have inherited an ACCESS app with poor table
normalization. There are thousands of records with no
primary key in most tables. While reading an old ACESSS 2K
book with accompany CD, I saw a sample of PK auto number
to PK auto number.
Time to rethink my approach.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top