I have a subform with a table in it. I have a two buttons in the table. The addTable button adds another instance of the subform (i.e. a new table). The delTable button is supposed to delete the table I am in. The code for remove is _subform.removeinstance(this.parent.index). The problem is that the remove button always removes the first table and not the table specific to itself:
Example 1: have table 1 and add another table. Hit delete on table 2 and it deletes table 1. Hit delete on Table 1 and it removes table 1 leaving table 2.
Example 2: have table 1 and add 2 tables. Hitd delete on table 2 and it deletes table 1. Hit delete on Table 3 and it removes table 1. Hit delete on table 1 and it deletes table 1.
What I would like it to do is to delete table 2 if that is the table I choose to delete. Anyone know what the code for that would be?
Thanks,
Mallard27
Solved! Go to Solution.
Views
Replies
Total Likes
It depends on your hierarchy when you say this.parent.index in your code. You need to find the correct repeating subform index which maybe a couple of levels above your current context. If you have a repeating table in a subform and you button is inside a row of the subform it could be that you should have this.parent.parent.parent.subform.
Views
Replies
Total Likes
It depends on your hierarchy when you say this.parent.index in your code. You need to find the correct repeating subform index which maybe a couple of levels above your current context. If you have a repeating table in a subform and you button is inside a row of the subform it could be that you should have this.parent.parent.parent.subform.
Views
Replies
Total Likes
Thanks Dohanlon! (this.parent.parent.parent.index) resolved the issue.
Views
Replies
Total Likes
Views
Likes
Replies