Automatically hiding subform on opening another subform

S

S Kahn

I use optButton_A to open a subform (frmSubform_A) . I would like
frmSubform_A to close when I click optButton_B to open another subform
(frmSubform_B).
Thanks in anticipation,
SK
 
O

Ofer

You dont close the sub form, you set it to visible false

Me.frmSubform_A.Visible = False
 
S

S Kahn

Thanks for the solution. However being a newbie.....would appreciate if you
could tell me as to where I would insert that code i.e under which event.
Thanks again
SK
 
O

Ofer

Insert the code in the After update event of the group frame where both
buttons are in.
Each button has a value, let say that optButton_A = 1 and optButton_B = 2

On the after update event of the frame you can write the code

Me.frmSubform_A.Visible = (Me.OptionButtonFrame = 1)
Me.frmSubform_B.Visible = (Me.OptionButtonFrame = 2)
 
S

S Kahn

Thanks, that was very helpful.
SK

Ofer said:
Insert the code in the After update event of the group frame where both
buttons are in.
Each button has a value, let say that optButton_A = 1 and optButton_B = 2

On the after update event of the frame you can write the code

Me.frmSubform_A.Visible = (Me.OptionButtonFrame = 1)
Me.frmSubform_B.Visible = (Me.OptionButtonFrame = 2)
 
Top