I am trying to achieve referential integrity and cascade delete related records between two of my tables tblActivity and tblDetailCompletePaperwork) - I get an error "no unique index found for the referenced field of the primary table" I am starting to wonder if this is because my tables are not structured properly.
I have three main tables:
tblGroups: Primary key is GroupNum field
tblActivity: Primary key is GroupNum, EffectiveDate, HealthCC and SubGroupNum
tblDetailCompletePaperwork: Primary key is GroupNum, EffectiveDate and DateReceived
The relationship I have set between tblactivity and tblDetailCompletePaperwork is with groupnum, effectivedate and datereceived
What happens is that there is only ever one company with one groupnum field in tblGroups. We could sell something and have a number of records entered into tblactivy. For example, if we sold two products there would be two records entered into tblActivity (the subgroupnum and HealthCC would differ) However, we would ony have one entry in tblDetailCompletePaperwork for transaction.
Just another note.... this same group we could sell more products to them (for example, next year) then we would add another entry for in tblActivity for each product sold and a single entry in tblDetailCompletePaperwork for the transaction.
Do I need to somehow modify my relationships?
Thanks!!!!
Fred
I have three main tables:
tblGroups: Primary key is GroupNum field
tblActivity: Primary key is GroupNum, EffectiveDate, HealthCC and SubGroupNum
tblDetailCompletePaperwork: Primary key is GroupNum, EffectiveDate and DateReceived
The relationship I have set between tblactivity and tblDetailCompletePaperwork is with groupnum, effectivedate and datereceived
What happens is that there is only ever one company with one groupnum field in tblGroups. We could sell something and have a number of records entered into tblactivy. For example, if we sold two products there would be two records entered into tblActivity (the subgroupnum and HealthCC would differ) However, we would ony have one entry in tblDetailCompletePaperwork for transaction.
Just another note.... this same group we could sell more products to them (for example, next year) then we would add another entry for in tblActivity for each product sold and a single entry in tblDetailCompletePaperwork for the transaction.
Do I need to somehow modify my relationships?
Thanks!!!!
Fred