General information
Category:
Coding, syntax & commands
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only