Refer to control on subform

  • Thread starter Thread starter DJW
  • Start date Start date
D

DJW

I have a main form named "Cases" and subform named "Time_Spent" . This
subform has a rectangle box/object I placed on it named "Box1" using the
toolbox. I would like to click on a button I placed on the main form and
make this object invisible but I do not know the proper reference to the
object using visual basic code. I tried using the line below but it does
not work

Me.subfrm_Time_Spent.[Box1].Visible = False

Secondly, how do I do the reversal... such as refer to "Box2" on the main
form by clicking on a button on the subform?
 
DJW said:
I have a main form named "Cases" and subform named "Time_Spent" . This
subform has a rectangle box/object I placed on it named "Box1" using the
toolbox. I would like to click on a button I placed on the main form and
make this object invisible but I do not know the proper reference to the
object using visual basic code. I tried using the line below but it does
not work

Me.subfrm_Time_Spent.[Box1].Visible = False

Secondly, how do I do the reversal... such as refer to "Box2" on the main
form by clicking on a button on the subform?


Assuming you have all the names correct (and don't forget
that you must use the name of the subform **control**)

Code in the main form to manipulate a control in a subform:
Me.subfrm_Time_Spent.FORM.[Box1].Visible = False

Code in a subform to manipulate a control on the main form:

Parent.Box2.Visible = False
 
Back
Top