Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community
SOLVED

parent and subform calling

Steel Contributor

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

 

 

5 Replies
I get a #name in each case
best response confirmed by Tony2021 (Steel Contributor)
Solution

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

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

@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.

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.
what a pain that was. I spent 3 hours on this.
1 best response

Accepted Solutions
best response confirmed by Tony2021 (Steel Contributor)
Solution

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

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

View solution in original post