locked
value from control in subform in form from navigation form RRS feed

  • Question

  • I have a navigation form where the navigation button has as the target a form that contains a subform with a control that I need to retrieve the value.  I do not get an error but I don't get any useful data returned, certainly not the data in the control.  I have referenced the control as follows:

    [Forms]![FrmMainN]!NavigationSubform.Form!SFrmKEIPMetWin.Form![CboSPMBroad]

    All references are spelled correctly.

    Thursday, May 11, 2017 6:24 PM

All replies

  • Hi,

    Without seeing your form(s), the syntax looks correct. You could also maybe try something like:

    Forms("FrmMainN").Controls("NavigationSubform").Form.Controls("SFrmKEIPMetWin").Form.Controls("CboSPMBroad")

    to see if it makes any difference.

    Hope it helps...

    Thursday, May 11, 2017 6:30 PM
  • ciao Terry,

    subForms are viewed as control by main form, so maybe this syntax also should be ok :

    in Vba :

    Me!NavigationSubform!SFrmKEIPMetWin!CboSPMBroad

    or as controlSource of a unBound textBox control.

    =[NavigationSubform]![SFrmKEIPMetWin]![CboSPMBroad]

    HTH.

    Sandro.

    Thursday, May 11, 2017 6:48 PM
  • Hi TerryFS,

    you had mentioned that ," I do not get an error but I don't get any useful data returned"

    can you show us what is should be return and what you got actually?

    as other community members had already suggested you the syntax you can try to refer.

    for further reference you can refer table below.

    To refer to a subform control property, like SourceObject    
    On Mainform N/A N/A
    On Sub 1 Me!Subform1.SourceObject N/A
    On Sub 2 Me!Subform1.Form!Subform2.SourceObject Me!Subform2.SourceObject

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, May 12, 2017 5:21 AM