Data entry to multiple tables linked by foreign key?

arjan

New member
I'm evaluating Dadabik, and I'm wondering if there's a way to insert data to multiple tables linked by foreign key.

Examples:
- A form to create a new record in a child table, with ability to not only reference but also create a row in the parent table, which is then used in the foreign key column of the record in the child table.
- A form to create a new record in a parent table, with ability to create one or more child records which will reference it.

Can this be done in Dadabik? Are there any examples of it?
 

eugenio

Administrator
Staff member
Hello Arjan,
about 1) yes, it is possible, you can use a select_single field and set the option "Other choices allowed?" to yes: in this way you can add custom options on-the-flay and the options will also be added as new records to the parent table. To see an example, run the first online demo, choose "movies", edit a movie and change the director select "other..." from the listbox; now specify a custom director and save. You can see that such new director has been inserted in the director tables.

2) I think you are referring to a master-details form here: run demo n.2, select "invoices" and try to edit an invoice to see the related invoice items.

Best,
 
Top