How do I use option group to open correct subform in retangle box

  • Thread starter Thread starter Karen B Rhodes
  • Start date Start date
K

Karen B Rhodes

I have option group with 3 buttons. When one is clicked...I want the correct
corresponding subform to open in retangle box next to option group.

I have buttons opening subform but it does it in new window not on main form

Thanks
 
You'd have to create an on click event for the option group and use a Select
Case statement for the code.

So something like

Select Case optiongroup
Case 1
Me.Subform1.visible = True
Case 2
Me.Subform2.visible = True
End Select

This is just an example, you'd have to work with it to make sure it also
hides the correct subforms... etc.
 
If you are using the OpenForm method, you will get the results you describe.
To open a form as a subform within the current form, you need to have a
subform control on the main form. Then you make the name of the form the
Source Object property value:

Me.MySubformControlName.SourceObject = "TheSubFormName"
 
Back
Top