How to disable a subform?

M

Me

I have a need to disable a subform upon certain condition. How can I do it?

I have a parent form with main form and two subforms. When the parent form
opens, depending on certain conditions, I would like one of the subforms not
to appear.

Thank you very much,
-Me
 
M

Marshall Barton

Me said:
I have a need to disable a subform upon certain condition. How can I do it?

I have a parent form with main form and two subforms. When the parent form
opens, depending on certain conditions, I would like one of the subforms not
to appear.


You probably just want to make the subform control
invisible:

If <some condition> Then
Me.subformcontrol.Visible = False
Else
Me.subformcontrol.Visible = True
End If

Or, if the condition is simple,

Me.subformcontrol.Visible = <some condition>
 
M

Me

Hi Marshall,

I get error for Me.subformcontrol.Visible = false

It says the subformcontrol is not found.

Any ideas? I did try a few other things but nothing seems to work.

Thank you very much,
-Me
 
M

Marshall Barton

You need to replace "subformcontrol" with the actual name of
the subform **control** (on the main form).
 
Top