JustJerry
10-06-2005, 10:42 AM
Ok, I'm back again, and I thought I understood the Referential Integrity when it came to Relationships between tables.
I have a 'details' table I call LINETbl. This table has some fields made up of Foreign keys related to four other tables. For Example: In LINETbl, I have a field called BootID. This field is related to the BootID in the master table of BootTbl. In the relationships window, I set up a one to many relationship for BootID between LINETbl and BootTbl and selected Referential Integrity AND Cascading Updates.
I 'thought' this was to ensure that if for some reason, the information in the Master Table of BootTbl was to ever change, that I could change the information in the BootTbl and the information stored in the related LINETbl would automatically be changed.
However, the Form I am using, which gets it's datasource from a query that includes BootTbl and LINETbl and a couple of other related tables, seems to have a problem. For simplicity, I have one field on my form that is based upon the BootID from the BootTbl. If, I do NOT enter any data in this field, as sometimes I do not need anything there, it tells me "You can not Add or Change a record because a related record is required in BootTbl".
IF I go into the relationships window and deselect the Referential Integrity option, then I do not get this error. I then assume that if part numbers, etc., change in my BootTbl, they obviously will not automatically be updated in the LineTbl as they would with the cascade update option selected. I 'guess' this might be ok as the records will show the parts as ordered at 'that time'.
I am obviously not completely understanding the Referential Integrity thing, and I even have a couple books I have read up on the matter.
I hope I made myself clear enough, cuz I'd sure like a clue as to what I'm missing.
Thank you,
Jerry
I have a 'details' table I call LINETbl. This table has some fields made up of Foreign keys related to four other tables. For Example: In LINETbl, I have a field called BootID. This field is related to the BootID in the master table of BootTbl. In the relationships window, I set up a one to many relationship for BootID between LINETbl and BootTbl and selected Referential Integrity AND Cascading Updates.
I 'thought' this was to ensure that if for some reason, the information in the Master Table of BootTbl was to ever change, that I could change the information in the BootTbl and the information stored in the related LINETbl would automatically be changed.
However, the Form I am using, which gets it's datasource from a query that includes BootTbl and LINETbl and a couple of other related tables, seems to have a problem. For simplicity, I have one field on my form that is based upon the BootID from the BootTbl. If, I do NOT enter any data in this field, as sometimes I do not need anything there, it tells me "You can not Add or Change a record because a related record is required in BootTbl".
IF I go into the relationships window and deselect the Referential Integrity option, then I do not get this error. I then assume that if part numbers, etc., change in my BootTbl, they obviously will not automatically be updated in the LineTbl as they would with the cascade update option selected. I 'guess' this might be ok as the records will show the parts as ordered at 'that time'.
I am obviously not completely understanding the Referential Integrity thing, and I even have a couple books I have read up on the matter.
I hope I made myself clear enough, cuz I'd sure like a clue as to what I'm missing.
Thank you,
Jerry