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
|
|||
|
|||
Cascade Update Related Fields Bug?
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 ? |
#2
|
|||
|
|||
On Mon, 27 Dec 2004 10:57:03 -0800, Mike_iDbM
wrote: 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] |
#3
|
|||
|
|||
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 "John Vinson" wrote: On Mon, 27 Dec 2004 10:57:03 -0800, Mike_iDbM wrote: 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] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Force Users to Update the Required Fields Before Saving Record | Mike | Using Forms | 1 | December 12th, 2004 07:13 AM |
Combo box to update other fields. | Scott Viney | Using Forms | 3 | October 6th, 2004 03:57 AM |
Fields Calculations & Update table | Faio | General Discussion | 0 | August 10th, 2004 11:23 AM |
header/footer update fields | fpca | General Discussion | 1 | May 30th, 2004 01:09 AM |
update fields filled with spaces to nulls | dkingston | Database Design | 2 | May 7th, 2004 06:04 AM |