Some points here:
1) The AfterUpdate Event occurs when the control loses FOCUS, so it does not occur when the 'Tick' box is 'Ticked', but when another control is selected, or the Enter or Tab key is pressed. So ticking the box will not cause the textbox to appear. It will take 2 steps. Better to use the OnClick event.
- Private Sub chkYourCheckBox_Click
-
Me.txtYourControlName.Visible = Me.chkYourCheckBox
-
Me.txtYourControlName2.Visible = Me.chkYourCheckBox
-
Me.txtYourControlName2.Visible = Me.chkYourCheckBox
-
End Sub
2) I would set the Enabled Property to True/False instead of the visible property. This would allow the operator to see what they were making available for use. When controls are not visible, a new operator may not find them. Visible but disabled shows them 'greyed-out' so the operator knows they exist: now only must figure out how to enable them.
3) If the subform View = Continuous Forms,
a) this will have to be done with Conditional Formatting. For Access 2003, the Enabled Property is available, but the Visible Property is not.
b) the tickbox will have to be bound to a table entry. An unbound control on a continuous form will change ALL the tickboxes when any one is ticked, and so Lock/Unlock or Show/Hide ALL the textboxes, not just the current record.
4) If the subform View = Single Form,
a) the tickbox my have to be set to False if not bound, and
b) the hidden/locked controls will retain the state of the previous record unless set in the OnCurrent Event.