Topic: Nested forms bug (?)

Hello.
I have a db with workers table, their competed works cards table(records liinked to workers).
I have a table -based form to view all works cards records, with + and - button to add and delete cards. + opens a form to edit new card with some blank field to fill AND a dropdown to select a worker to assign to the card. Near the dropdown ai added a + button that opens the worer details edit form to add a new worker to the system without closing the card edit form.
So, i go Cards Form -> + -> Card Edit Form -> + -> Worker Edit Form.
All forms remain opened.
The problem: when i click + on Card Edit Form , at the moment Worker Edit Form opens the system (MVDB) automatically clicks Save button on Card Edit Form creating an empty record in the Cards table. This is unexpected and not required as adding a worker to DB doesnt require linked Card...
Please help me with it. The only way i found to workaround this was to disable Save button action (setting to no action anually in designed). But i cant set it back to Save Data action from code...

Thanks in advance!

2 (edited by derek 2019-12-24 10:02:38)

Re: Nested forms bug (?)

Hi,
If you can zip your project  (without the .exe) and upload it,  then someone in the Forum should be able to take a look and get back to you.
However, as an option, I'd suggest you change the processing logic slightly - instead of adding a new employee DIRECTLY from the workcard form, go via a form that shows all employees with the option to add / change / delete employees from there.  This removes the original issue (empty row) but also has 2 additional benefits;
1) you can now use the same form to not only add but also change and delete employees (not sure how you'd otherwise planned to do that)
2) it's now not possible to create a work card with a blank employee, so it is more rigorous without having to write any additional code.
Please see the attachment.
Regards,
Derek.

Post's attachments

Attachment icon workercards.zip 338.07 kb, 214 downloads since 2019-12-24 

Re: Nested forms bug (?)

Hello, derek.

Looks like your solution works for me. Thanks alot for your help!