How to prevent widow records?

Icehousman2

Registered User.
Local time
Yesterday, 20:33
Joined
May 12, 2004
Messages
45
What is the best way to prevent widowed records? By widow record I mean records in the parent table that do not have a related record in the child table.

I have a tblOrder that is linked to a tblProductOrder by the OrderID field. I don't want the user to be able to create a record in tblOrder without adding some products to the order, which will be stored in tblProductOrder.

Thanks for the help.
 
Widow

In the joins property between those 2 tables make sure you Enforce Referential Integrity and check the cascade boxes.
 
Widow

Thanks for the quick response.

I checked the cascade boxes on the back end, but when I go to the relationships window on the front end the boxes are unchecked and grayed out so I can't change them.
 
integrity

It's the backend you are concerned about. To test if your issue is resolved create a form with the main table as the source (although you probably already have. ) Put a subform in it that has the details table as it's source. If you try to put a record in the subform where no data exists in the main form it shouldn't let you.

If you did not split the backend you could check the referential integrity and cascade buttons in the front end. But always split the database as you have done.
 
Thank You

Thanks Pat and Rickster that is what I needed to know. This forum saves the day yet again.
 

Users who are viewing this thread

Back
Top Bottom