SourceObject Question

George Too

Registered User.
Local time
Today, 13:53
Joined
Aug 12, 2002
Messages
198
I have done a search on SourceObject postings but I'm still confused.

I have a form with a TabControl wich has in one of its pages a subform. I want the SourceObject of the subform to change based on the selection of a combo box.

I have tried the following:

me.childfrmHigh.sourceobject = subfrmHighScores

me.childfrmHigh.sourceobject = forms!subfrmHighScores

None of these work. What's the correct sintax, help is no help in this case. Do I need to have the TabControl in the sintax too?

Thank you.
 
On the afterupdate event of your combobox (on your main form), requery your subform.
 
But I still need too tell the sub form where to get the source object from. The combo part is not the problem, I can cover that with If statements, my real problem is the right sintax for setting the SourceObject property with VBA for a subform.

Thanks.
 
me.childfrmHigh.sourceobject = "subfrmHighScores"

Treat the subform's name as a string.
 

Users who are viewing this thread

Back
Top Bottom