Tab Control subform recordsource

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a tab control form with subforms on the pages of the tab control.
I am trying to change the recordsource of the subform based on changing of a
combo box on the main form. When I refer to the recordsource of the subform
on the tab control page, I am getting 'Object doesn't support this property
or method'.

I am also getting the same message when trying to use the recordsetclone
method on the subform. Are these methods unavailable when using tab-controls
and sub-forms?

I am using the following format to refer to the recordsource:

forms!frmviewproject!tabctl24.pages("Parent
Agreement").controls!sfrmProjHeader.recordsource = ......

where frmviewproject is the main form, tabctl24 is the tab control with
Parent Agreement as the page and sfrmprojheader is the subform that exists on
that page.

Thanks!
 
Try ...

forms!frmviewproject!tabctl24.pages("Parent
Agreement").controls!sfrmProjHeader.Form.recordsource = ......
 
Nat said:
I am using a tab control form with subforms on the pages of the tab control.
I am trying to change the recordsource of the subform based on changing of a
combo box on the main form. When I refer to the recordsource of the subform
on the tab control page, I am getting 'Object doesn't support this property
or method'.

I am also getting the same message when trying to use the recordsetclone
method on the subform. Are these methods unavailable when using tab-controls
and sub-forms?

I am using the following format to refer to the recordsource:

forms!frmviewproject!tabctl24.pages("Parent
Agreement").controls!sfrmProjHeader.recordsource = ......

where frmviewproject is the main form, tabctl24 is the tab control with
Parent Agreement as the page and sfrmprojheader is the subform that exists on
that page.


Note that, in addition to needing to go through the .Form
property, you do not need to go through the tab control.
All the controls on all the tab pages are members of the
form's Controls collection, so this is sufficient:

Me.sfrmProjHeader.Form.RecordSource = ......

Just make sure that sfrmProjHeader is the name of the
subform CONTROL that contains the form object being
displayed as a subform.
 
Back
Top