locked
How can I get a child to change data on parent controls? RRS feed

  • Question

  • I've got a child datasheet for customer Orders. When I click on an order on the child, I want the parent's controls like txtOrderDate and txtPrice to populate.

    I'm able to create a Public Long variable in the parent to hold an OrderID. And I'm able to pass that ID to the parent on the Current event of the child datasheet. But I can't seem to call methods of the parent from the child to tell the thing to update data in its controls.

    I've got a Public Sub DisplayOrder() in the parent which simply sets the control value like this: Me.txtDate = DLookup("ContractOrderDate", "Orders", "ContractID = " & mCurrentOrderID)

    But I'm not able to call that parent sub from the child. I get Run-Time error 440: You can't assign a value to this object.

    How should I be doing this? I also tried to have the child change the values of the parent controls during the child's current event, but couldn't do that either!
    Tuesday, April 19, 2016 4:30 PM

All replies

  • Hi HTHP,

    you want to call parent form right?

    did you try like below code

    Me.Parent.conProjectTitleCB_AfterUpdate

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 20, 2016 10:14 AM
  • Hi HTHP,

    does your issue get solved?

    or you still facing problem regarding your issue?

    if you found any solution then would you like to share it with our community?

    so that if any other community member have same issue like you can also get solution.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 28, 2016 6:43 AM