How to hide a subform ....

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

Hi,

I would like to know on how to hide a subform that is nested on subform
that is nested on a main form based on a value of a checkbox.
I have tried many combination of the following line of code but bo success.
My sub-subform is still visible

If Surplus Then
Forms!frmOwnedProperties.frmPropCosts.Form.frmPropSales.Form.Visible =
True
End If

TIA
 
Alain said:
I would like to know on how to hide a subform that is nested on subform
that is nested on a main form based on a value of a checkbox.
I have tried many combination of the following line of code but bo success.
My sub-subform is still visible

If Surplus Then
Forms!frmOwnedProperties.frmPropCosts.Form.frmPropSales.Form.Visible =
True
End If


It's the subform control that you want to make invisible,
not the form object it's displaying:

Forms!frmOwnedProperties.frmPropCosts.Form.frmPropSales.Visible=False

Depending on where that line of code is located, you might
be able to shorten that line significantly by using Me to
reference the form containg the line of code.
 
Back
Top