View Single Post
  #16  
Old November 1st, 2008, 11:43 PM posted to microsoft.public.access.tablesdbdesign
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Using Autonumber as PK, cascade update doesn't work?

I believe David meant "there's NO reason to ever use ..."

David was pointing out that using CASCADE UPDATE only makes sense when the
value of the primary key changes. Since you cannot change the value of an
AutoNumber field, that means there's no point setting CASCADE UPDATE on any
relationships to the AutoNumber field.

I don't see David saying not to use AutoNumber fields though.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Howard Maidman" wrote in message
...
Hi David,

Take it you mean 'never' use autonumber as a primary key? However, it is
the only unique field in my table so don't know what else to use. Must
admit
I am new to Access and find it a real struggle so will probably stick to
Excel anyway.

Thanks

"David W. Fenton" wrote:

"Rick Brandt" wrote in
:

Howard Maidman wrote:
I too am using AutoNo. as primary key and cannot even get this to
populate itself in a subtable of a one-to-many even though I have
successfully created an accepted ref integrety with cascading
updates etc!

Anybody got any ideas?

What do you mean by "populate itself"? Cascade update updates
*existing* children records when the key field of the parent is
updated.


Except with an Autonumber, the parent value can never change
(Autonumbers are, by definition, not editable), so there's reason to
ever use CASCADE UPDATE on a relationship where the parent side is
an Autonumber PK.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/