Accessing subform properties from parent

alien251alien251 Member Posts: 80
I'd like to set the EDITABLE property on some columns in a subform from the parent. The property would be set based on the status of the purchase order, if the status is released then only some of the fileds on the subform would be editable.

How can I do this?

If PurchLines is the subform, the first line works in setting all of the columns to not editable. The second line generates a variable not defined error, I tried it with an without the angle brackets...

1: CurrForm.PurchLines.EDITABLE := PurchaseOrderIsReleased(Rec.Status);
2: CurrForm.PurchLines."Gen. Prod. Posting Group".EDITABLE := PurchaseOrderIsReleased(Rec.Status);

Any ideas...?

Thanks,

Dan

Answers

  • vijay_gvijay_g Member Posts: 884
    it can be done by another way as far as my knowledge.

    but in this case u need to predefine all the fields that you want to editable or not.

    first of all you have to make a function in the form(54) that is attached in subform and
    after that in the function body u have to write this code like........

    CurrForm.Description.EDITABLE(true);
    CurrForm."Unit price".EDITABLE(true);

    after that you have to call this function where u want to do this.
    to call function the code like this...

    CurrForm.PurchLines.FORM.EditableField;

    here EditableField is a function..........

    Vijay Kumar Gupta
  • alien251alien251 Member Posts: 80
    Thank you Vijay!

    This worked for me, it's important to note that the function exposed on the subform needs to be setup as Local=No, so the function can be called from the parent.

    Thanks,

    Dan
Sign In or Register to comment.