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

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
 
A

akphidelt

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.
 
K

Klatuu

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top