ACC2000: Nulls Allowed in Foreign Key with Referential IntegrityID: Q208391
|
Microsoft Access allows a Null value in a field that is the foreign key in a relationship even if referential integrity is enforced.
To prevent users from leaving the foreign key blank, set its Required property to Yes.
This behavior occurs whether you use a single-field primary key and foreign key or a multiple-field primary key and foreign key. However, Microsoft Access allows a Null value in a field that is part of a multiple-field foreign key only if every other field of the foreign key also contains a Null value. If at least one field of the foreign key contains a Null value and at least one other field of the foreign key contains data, you receive the following error when you try to save the record.
You can't add or change a record because a related record is required in table <one-side table>.
This error message is due to the feature called the Lookup Field. For more information about this feature, click Microsoft Access Help on the Help menu, type "create a field that looks up or lists values in tables" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.The text you entered isn't an item in the list.
Field 'Orders.CustomerID' can't contain a null value
For more information about data integrity, click Microsoft Access Help on the
Help menu, type "what is referential integrity" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words: null compact cascade prb
Keywords : kbdta GnlApp
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 13, 1999