View Full Version : Alter Source Object of Subform


jwindon
02-01-2002, 11:16 AM
Is it possible to alter the Source Object of a subform similar to altering the control source?

For example, I want to toggle the subform that is visible based on a selection on the main form. The subform is unbound and not linked to the main form in anyway other than the Select Case I will fire to determine what form I want to use for this subform (if this is even possible).

Thanks for any clues.

Fizzio
02-01-2002, 11:44 AM
Would it be feasible to pile your subforms on top of another and then use the visible and enabled properties to select the one to show? Just guessing though http://www.access-programmers.co.uk/ubb/smile.gif

Rich
02-01-2002, 11:47 AM
Or you could use a tab ctrl and remove the tabs, just use SetFocus
HTH

jwindon
02-01-2002, 12:42 PM
Thought of the piling thing and hoped there is a better way.

Rich: Interesting idea. I'll look at that.

Let you know how it turns out.

Thanks!

jwindon
02-01-2002, 01:15 PM
Many thanks to Jack Cowley for providing me with this answer!

Private Sub ***Click()

'change source object of subform to Materials-Data switchboard

Me.subformname.Visible = True
Me.subformname.SourceObject = "frmFormName"

End Sub

Not using the select case after all. Found another way.

Thanks to you all for the ideas. May come in handy another time.