show subform based on toggle

P

papa jonah

I have a form that includes a toggle switch. Depending on which option
is selected, I want a subform to be displayed. I do not care if the
subform is there but not visible and becomes visible, or if the toggle
actually causes it to open. I have not figured out how to do this with
either code, macro, or whatever the other option is.
Any help would be appreciated.

TIA
Papa
 
D

Dennis

In the click event of your toggle button try this code
If Me.SubFormName.Visible = True Then
Me.SubFormName.Visible = False
Else
Me.SubFormName.Visible = True
End If
 
Top