To start with, all references should be relative to the
Me reference.
For the basic information from which you should be able to determine this for yourself, see
Referring to Items on a Sub-Form.
I'll assume, from what's in your question, that the following is an accurate description of what you're working with :
- Name of main form = [fis_npcaptureF].
- Name of CheckBox control = UNKNOWN. I will refer to it for now as [chkVis].
- Name of option group in which [chkVis] seems to have a value of 1 = [columns].
- Name of Tab (or Page) control = UNKNOWN. Also irrelevant so I will not refer to it at all.
- Name of the subform control on the Tab (or Page) = [NPCaptOtherSF].
- Name of control on the form, within the subform control, that you intend to show/hide = [NPItemtype].
Unfortunately, I have no info as to whether or not anything is bound, so I will assume for now that it is. An unbound form would not require a
Form_Current() event procedure.
- Private Sub Form_Current()
-
Call ShowHide()
-
End Sub
-
-
Private Sub columns_AfterUpdate()
-
Call ShowHide()
-
End Sub
-
-
Private Sub ShowHide()
-
With Me
-
.NPCaptOtherSF!NPItemtype.Visible = Not .chkVis
-
End With
-
End Sum