handle values for calculation

Hi, I have an open sub-form with several items, and want a specific field from the active line (selected) to be used in calculation in the main form, as soon as I click OK on sub-form, and close it. What should I do? Thanks.

Hi! When you run the Sub-Form, you should do that by Source-Code: MainFormTrigger() … SubForm.RUNMODAL; … When a field of a selected record is activated, you could save the field-value in a global variable: Field OnActivate() … FieldValue := Field; … Your Subform should contain a function, that is returning that variable: Function GetFieldValue() … Exit(Fieldvalue); So, when calling your Subform by code, you can call this function the receive the Field-Value: MainFormTrigger() … SubForm.RUNMODAL; Value := SubForm.GetFieldValue(); … Now “Value” contains the SubForm-Field-Value. Well, that’s a little “raw”, but that way should do it. Regards, Joerg A. Stryk Apollo-Optik, IT/ERP

You can use: SubFormRecord := CurrForm.SubForm.FORM.GETRECORD() Business Applications Programmer Sertified Navision Developer SIA “Sintegra” Latvia