Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello I have a problem. I want to

Status
Not open for further replies.

Tom123456

Programmer
Apr 2, 2003
70
SE
Hello
I have a problem. I want to update my control for my subform with a new subform. This is really hard to explain but I hope someone understand. To update I use a radio button that runs a Basic code on focus like

Private Sub radio1_GotFocus()
Me.F_Subform1.SourceObject = ????
End Sub

What should I write instead of the questionmark to tell the control to view a new subform.

:|!

- Tom
 
Use the name of the Form.

I wouldn't use the gotfocus event, though. If your option button is contained in a frame (which I would recommend), use the afterupdate event of the frame.

You'd end up with something like this

Private Sub FrameName_AfterUpdate()
dim FormName as string
select case me.framename
case 1: formname = "form1"
case 2: formname = "form2"
case end
Me.Form1.SourceObject = formname
End Sub

-Coco

[auto]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top