The good lord knows how to keep me humble. The second I think I'm really picking this stuff up, I come across a problem that I still can't solve after spending all day proving that I just couldn't do it 'that way'. And now that I have my wife asking why I didn't spend more time with my son today, I feel as though I should have just asked for help earlier.
So, my form below:
I basically have a form within a form. The entire form repeats; and the sections Building Improvements and Property Value -Other are each dynamic.
The Building Improvements is the section giving me problems. If 'Yes' is selected, the 5 check box sub-sections appear; when the check box is selected, the Year Field and Describe Field appear.
If No is selected, all 5 subsections become hidden and any entry is cleared. Also, un-checking the subsection box also clears the Year and Describe Fields.
I welcome any and all suggestions or help regarding any aspect of my form design. I will not be offended at the least and welcome the help. It's all a learning experience.
p.s. Hi Niall
Check the attached form..
Changes I did.
1) I wrapped all the 5 sections of the checkboxes to a single subform and named it as Improvements.
2)When you click on Yes for the Builing Imporovements, I am hiding all the Year and Description fields.
3) When Wiring is selected I am making the presence to visible for Year and Details and did the same for other fields.
4) When No is selected, I am clearing off all the Year and Description fields and then deselecting the 5 Checkboxes.
Thank you for your help.
I've gotten this far before; but as you can see, when the form repeats, the Building Improvement section is hidden on the completed form and completely visible on the the new blank form.
Few thoughts about the issue..
Since your form is dynamic you need to resolve nthe node using the index of the current instance..In your case you are adding the instance of PropertyLocation in your form. So code your write in any of the event under this subform "PropertyLocation", you need to resolve the instance manager to the current index. Otherwise it will take the default instance which is "0", the first one. You can check the click event of any of the check boxes to see how I am resolving the node to the current index.
You are writing the code in the Form Ready event of the Year and Descriptions to hide. Instead you need to check the value of the check box either in the Form Ready/ Inititalize event and then hide and display based on the check box value. I have put the code in the initialize event to achieve this. Alternatively you can do the same in the Form Ready event.
Updated form is below..