Hiding SubForm

J

Jay

I cam across a post on this board giving code on how to hide a subform
depending on if a check box was true or fals. I am trying to recreate and
can hide the subform based on the checkbox's initial value when opening the
form/subform, but if I check the checkbox to hide/unhide the subform, it does
nothing. Any suggestions on what I am missing.

Switch = checkbox field
ViewNoteForm = subform.

Private Sub Form_Current()
If Me!Switch = True Then 'checkbox on parent form
Me!ViewNoteForm.Visible = True 'subform
Else
Me!ViewNoteForm.Visible = False
End If
End Sub
 
D

Douglas J. Steele

Check that the name of the control on the main form that holds the form
being used as the subform is, in fact, named ViewNoteForm. Depending on how
you added the subform to the main form, the name of the subform control may
not be the same name as the form being used as a subform. (You want the name
of the control)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top