how to reference a subform within a tab control

G

Guest

I am tyring to dynamically change the source object of a subform datasheet
dependant upon a combobox selection of query names where the subform is
located within the first page of a tab control.

My main form is based on a table that contains query names and titles, and
other related data. This main form contains the combobox and tab control. The
combobox lists the query names, finds the selected record, displays the other
related data on the second page of the tab control, and changes the caption
of the first tab control page to match the title of the selected query name
record. The first tab control page is suppose to also display the query
content of the selected query name. I am stuck though on how to reference the
tab.variablepage.subform.source object within the After Update event of the
combobox.

Any help is appreciated.

LF
 
A

Arvin Meyer [MVP]

Are you trying to change the sourceobject (the subform's form itself) or the
recordsource property?

In either case, the tab (or actually page) is ignored in the reference:

Forms.FormName.SubformName.Form.SourceObject = "sfmMysubform"

or

Forms.FormName.SubformName.Form.RecordSource = "qryMyQuery"
 
G

Guest

Are you trying to change the sourceobject (the subform's form itself) or the
recordsource property?
The Source Object because my subform control is unbound.
Forms.FormName.SubformName.Form.SourceObject = "sfmMysubform"
I tried this but the VB window doesn't recognize any parameters beyond
Me![subctrlName].Form

It does produce my desired functionality though when I tried this
Me![sfmMysubform].SourceObject = "Query." & strQryName

Thank you for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top