Subform creating orphan records?

It also appears to me that if the Primary Key cannot be null...why would Access allow the foreign key to be null when "enforce referential integrity" is turned on?
Because "enforce referential integrity" refers to Deleting Records/Editing Records. The 'Foreign Key' concept isn't something Access does automatically. You have to actually tell Access to 'link' a Primary Key to a Foreign Key. Otherwise, the 'Foreign Key' is simply a Field in the secondary Table.

The answer here, I think, is in the BeforeUpdate event of the Form the Subform is based on, dump the Record, in the Form_BeforeUpdate event, if the Foreign Field is Null.
 

Users who are viewing this thread

Back
Top Bottom