Rx_
08-09-2010, 01:57 PM
Access 7 Solved, just adding these remarks for someone else to save time.
Updating a database.
Replaced a table RegulatoryType with tblRegulatoryType
The Enforce Referential Integrity for a one-to-many relationship was on.
A CBO box chooses an RegulatoryType from the list and updates a linked row in its related table (TableMainForm).
So, throughout the form, list box, combo box, TableMainForm's data source... update all the queries from RegulatoryType to tblRegulatoryType. (in other words - go update the form's objects to reference the newer replacement table ... tblRegulatoryType)
In the Tables objects - (menu) Database Tools - Relationships
Deleted the RegulatoryType table from the relationship.
Created the replacement relationship using tblRegulatory.
The tblRegulatory isnow linked to TableMainForm to the same field.
(in other words, we substituted a new table for another and set it up the same.)
Back at the form - tried to enter one of the new record items in tblRegulatoryType that is not in RegulatoryType.
Error - 3201 You cannot add or change a record because a related record is required in table 'RegulatoyType'
Go back to Relationships view - and it clearly did not exist.
Solution: This relationship is hidden.
The old relationship to RegulatoryType use to be on RegulatoryTypeID. The new relationship to tblRegulatoryType does show on the RegulatoryTypeID. Only one is showing because the RegulatoryType table was deleted.
But, it turns out that the relationship still exist!! It just does not show.
On the TableMainForm - right click on the RegulatoryTypeID field. Choose Show Direct from the menu.
The hidden relationship from this field to the old RegulatoryType now appears.
Delete the relationship first. Now the legacy RegulatoryType table can be removed from the Relationship table.
Hope that this saves someone else some time.
Updating a database.
Replaced a table RegulatoryType with tblRegulatoryType
The Enforce Referential Integrity for a one-to-many relationship was on.
A CBO box chooses an RegulatoryType from the list and updates a linked row in its related table (TableMainForm).
So, throughout the form, list box, combo box, TableMainForm's data source... update all the queries from RegulatoryType to tblRegulatoryType. (in other words - go update the form's objects to reference the newer replacement table ... tblRegulatoryType)
In the Tables objects - (menu) Database Tools - Relationships
Deleted the RegulatoryType table from the relationship.
Created the replacement relationship using tblRegulatory.
The tblRegulatory isnow linked to TableMainForm to the same field.
(in other words, we substituted a new table for another and set it up the same.)
Back at the form - tried to enter one of the new record items in tblRegulatoryType that is not in RegulatoryType.
Error - 3201 You cannot add or change a record because a related record is required in table 'RegulatoyType'
Go back to Relationships view - and it clearly did not exist.
Solution: This relationship is hidden.
The old relationship to RegulatoryType use to be on RegulatoryTypeID. The new relationship to tblRegulatoryType does show on the RegulatoryTypeID. Only one is showing because the RegulatoryType table was deleted.
But, it turns out that the relationship still exist!! It just does not show.
On the TableMainForm - right click on the RegulatoryTypeID field. Choose Show Direct from the menu.
The hidden relationship from this field to the old RegulatoryType now appears.
Delete the relationship first. Now the legacy RegulatoryType table can be removed from the Relationship table.
Hope that this saves someone else some time.