Information générale
Catégorie:
Codage, syntaxe et commandes
>I'm attempting to use the append blank method
>of inserting a record into a table but the referential
>integrity is stopping me because before the fields
>are populated the record violates all kinds of rules.
>Any suggestions?
Try this Chris.
Assume you have a Master table and a Child table related by key fields K1 and K2. Go to the database dictionary, modify the Child table by plugging in the following default values for K1 and K2:
For K1: iif(used('master'),master.k1,'')
For K2: iif(used('master'),master.k2,'')
Now when a blank Child record is generated and if the Master table is in use somewhere, then the Master's K1 and K2 values will be placed in the child's K1 and K2 fields and your referential intergrity is preserved. If the Master table is not in use when the Child record is created, then the Child's K1 and K2 will be Null's and you'll be no worse off then before.
Paul
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement