Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Jul 25, 2023

parent and subform calling

Hello Experts,

I have a bound parent form (frmPPA)

I also have a subform (subfrmPPA)

I have an unbound field on frmPPA and I want to populate it with the value from subfrmPPA.ProjIDfk (the name of field is txtProjIDfk)

I have tried many different combinations to no avail. 

 

I thought the strategy for a bound form is:

Forms!mainformname.subformname.form.yourfieldname

I have tried: 

=[Forms]![frmPPA].[subfrmPPA].[Form].[txtIDPrjDet]

=[Forms]![frmPPA].[subfrmPPA].[txtIDPrjDet]

=[frmPPA].[Form].[txtProjIDfk]

=[Forms]![frmPPA].[txtProjIDfk]

=[Forms]![frmPPA].[forms].[txtProjIDfk]

 

I dont know what I am doing wrong. 

thank you

 

 

  • Tony2021 This simple expression should work. Try it please and let us know.

    =[subfrmPPA].[Form]![txtIDPrjDet]
  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    Tony2021 This simple expression should work. Try it please and let us know.

    =[subfrmPPA].[Form]![txtIDPrjDet]
  • Gustav_Brock's avatar
    Gustav_Brock
    Brass Contributor

    Tony2021 I think what you are after as ControlSource is:

    =[subfrmPPA].[Form]![ProjIDfk]
    - or:
    =[subfrmPPA].[Form]![txtProjIDfk]

    Please note, that subfrmPPA must be the name of the subform control which may differ from the name of the subform itself.

    • Tony2021's avatar
      Tony2021
      Steel Contributor
      I think my form was corrupted. I created another form and the unbound fields then populated with the data. thanks guys. Appreciate it. Both answers worked.
    • Tony2021's avatar
      Tony2021
      Steel Contributor
      what a pain that was. I spent 3 hours on this.

Resources