Cascade Update Related Fields Bug?

G

Guest

I have set up one to many relationship between an order table (master/one)
and a order details table (slave/many) using the related field orderID .
This field is the primary key in the order table . I have set the enforce
referential integrity and the checkboxes for both cascade update and cascade
delete related feilds functionality . When I enter data into the related
feild orderID in the order table the order details field is not updated as I
would expect . However when I delete the data entered into this feild in the
order table ( I manually entered the same data into this feild in the order
details table) the data was also deleted from the order details table. I
concluded that the delete cascade function seem to work fine. So why does the
cascade update not work ?
 
J

John Vinson

When I enter data into the related
feild orderID in the order table the order details field is not updated as I
would expect . However when I delete the data entered into this feild in the
order table ( I manually entered the same data into this feild in the order
details table) the data was also deleted from the order details table. I
concluded that the delete cascade function seem to work fine. So why does the
cascade update not work ?

It's working correctly - it's your interpretation that is off!

A relationship does not, and SHOULD not, automagically create a new
empty placeholder record in the child table. A relationship *prevents*
you from adding "orphan" records; it does not create new records.

Normally one would use a Form bound to the order table, with a Subform
bound to the order-details table, with the OrderID as the master/child
link field. When there is data to be entered into the details table
(but not before!), the user would start entering data on the subform;
at that point the new record will be created. There is no need or
benefit to adding empty "placeholder" records.

John W. Vinson[MVP]
 
G

Guest

Yes , you are absolutely correct thank you for the precise clarification. I
tested your suggestion and the cascade update function works fine once the
record is
created and not before as you say empty placeholders are not a good thing.
This was my first question in this forum and I am truly impressed and
appreciative.

Thanks Again
Mike
 

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