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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a SubForms SourceObject

Status
Not open for further replies.

GGleason

Technical User
Mar 22, 2001
321
US
I have made the supposition that you can change the SourceObject when you have a toggle button on a form. Here is part of the code for the Click event:
[tt]
frmIdfProcSub.SourceObject = IIf(togIdfLocDups.Value = True, _
"frmIsoControlSub4qryIDFlocationDupLocs", _
"frmIsoControlSub4qryIDFlocation")
[/tt]
It successfully changes the subforms SourceObject, but the data does not change at all. Is my supposition incorrect or am I missing a step?

tia,
GGleason
 
Your assumption is correct. But, you must perform a requery of the subform to refresh the data with the new source object.

me![frmIdfProcSub].requery

That should do it.

 
Thanks for the suggestion. But what I eventually did in my case (because of other factors) was change the record source instead of the object source, which worked. I could do that in this case because the field information was identical to the other query.

GGleason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top