Page 1 of 1

Master-Detail Insert New Record. ?How

Posted: Thu 13 Nov 2008 00:50
by Dokkie
I've constructed a Master_detail relationship using the mastersource property etc.
As stated in the pdf manual I can add detail records with each record automatically using the master table's linking field value. This only works if the master record already exists.

I'm having trouble with inserting a new Master table and it's associated detail table. Even if I set the generator property in the Master table it's not picked up by the detail table.
I've tried Posting the Master table then posting the Detail table it's still not picked up.
I can set the link field value On the OnNewRecord event but I'm wondering if I'm misunderstanding how this is supposed to work - when inserting a new Master record with a new related detail record.

Peter

Posted: Thu 13 Nov 2008 08:57
by Plash
You should insert and post a record in the master table. Make sure that the key field in the master table has a value after posting.

Then you can insert detail records. These records will take value for the linked field from the master table.