We have a form that has a table. When the form opens, we have 1 out of the 5 columns, hidden on the table. Let's say the Column 3 is the hidden column. We have created that so far.
Beneath the table, we have a checkbox that that shows and hides Column 3. This button works perfectly if we only have one row of data. If there are multiple rows, this button applies to the first row only.
To get additional rows added to the table, we have an "Add Row" button and a "Remove Row" button, which adds or removes rows another beneath the first row. When it adds the row, it adds 5 columns, regardless of what the checkbox previously mentioned says. When that checkbox is checked, it should have 5 columns across. When it's unchecked, there should be 4 columns across, with Column 3 hidden. When the checkbox is unchecked, it is still creating 5 columns, because the 3rd column should be hidden.
I've searched and searched and haven't figured out how to get the checkbox to apply to all rows created in the table. As previously mentioned, it works on the first row only. How can I get the checkbox to apply to the dynamically created rows in addition to the first row?
The next question I have is, how can we create a row to the table with 4 columns when that checkbox is unchecked and 5 columns when that checkbox is checked?
The last question I will have will be in regards to getting a total added up in Column 5 of the table footer. We will need to add up the fields in the table.
I was able to get all this to work properly with a static table with rows defined. I haven't been able to figure this stuff out with a dynamic, expanding table.
I haven't seen where I can attach a pdf. I know these are sometimes easier if the pdf is posted here also. I don't think I'm allowed as this is my first post.
Here is what the form looks like when checking the Show/Hide Column checkbox...
Here is what the form looks like with a row added...
Here is what the form looks like with when we try to hide Column 3 with an added row...
As you can see, only the header row, first row, and footer row are now hidden. Rows 2+ do not get hidden.
How can we get Column 3 hidden for Rows 2+ with the checkbox? I can't figure out what rows 2+ are called after they are added. I tried using _, *, [*], (*) in different locations for the Show/Hide Column checkbox on Row1 for Column 3 and haven't figured it out. I also tried putting the cells in Column 3 into a subform and still no luck.
The code for when the document loads (hides column 3), the Add Row button, the Remove Row button, and the Show/Hide Column checkbox is below. Hopefully that can help people help me.