I'm trying to set the access of a subform based on the value of a checkbox in another subform. In the change event of the checkbox, if the rawValue == 1, then I attempt to set the access of the second subform to "protected". If the rawValue == 0, I set the access of the second subform to "open".
What actually happens is that the access of the second subform is unchanged. In fact, when I try to even display the value of the access attribute of the second subform from the change event of the checkbox, the value displays a s null. What am I doing wrong?
Here's the code that sets the access: ('this' is the checkbox.)
if (this.rawValue == 1) {
parent.parent.subform2.access = "protected';
}
else {
parent.parent.subform2.access = "open";
}
The hierarchy is this:
Mainform
subform1
checkbox
subform2
< Other Objects>
Subform2 is a repeatable subform, so when I set the access to "protected", I also want to remove all instances except the first one.