A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cascade Update Related Fields Bug?



 
 
Thread Tools Display Modes
  #1  
Old December 27th, 2004, 06:57 PM
Mike_iDbM
external usenet poster
 
Posts: n/a
Default 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  
Old December 27th, 2004, 08:49 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old December 27th, 2004, 09:37 PM
Mike_iDbM
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.