In the OnChange event of the option group control (not the options
themselves), use this code, assuming the values tied to your option group are
1, 2 and 3
Private Sub OptionFrame_Change()
Select Case OptionFrame
Case 1
Me.SubformControl1.Visible = True
Me.SubformControl2.Visible = False
Me.SubformControl3.Visible = False
Case 2
Me.SubformControl1.Visible = False
Me.SubformControl2.Visible = True
Me.SubformControl3.Visible = False
Case 3
Me.SubformControl1.Visible = False
Me.SubformControl2.Visible = False
Me.SubofmrControl3.Visible = True
End Select
End Sub
Note that SubformControl is the name of the Control that holds the subform,
not the name of the form itself. It's best to make these different (I
generally prefix "ctl" to the name of the control). I haven't tested this
but I believe it should work. You can probably use the AfterUpdate event of
the option group control rather than the Change control, if you like.
hth
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"jfullingim" wrote:
> I have a form with 3 subforms and I want to use an option group to select
> which subform is visible. Option1 = only Subform1 is visible. Option2 =
> only Subform2 is visible. Option3 = only Subform3 is visible. This seems
> like it should be fairly simple, but I can't seem to get it to work. Any
> help would be greatly appreciated!
>
> Thanks!