Passing parameters to and from forms

Hi I have the following scenario i need to code. I have an “Interview” Form, in this form i want to perform a lookup to “Reasons for Interview” Form which contains all the reasons. I want to be able to select a Reason and pass back an ID and Reasons Text which are fields to the calling form. Now, i know how to pass values to a called form, but how do i pass back values to the calling form once i’ve done something in the called form. Thank-you Theo.

use the closeSelect() method on the second form. Overload the method and pass your data through the super(right here); this value will be inserted into the control the lookup was called from. And to pass extra values you could use something like this: in the lookup form in one of the close methods you can call a method of the calling form with parameters. like so: in the close method it will be this instead of element element.args().caller().MYMethod(parm1, parm2) and in the calling form you can get the values into variables and use them later

Hi Ivan, You are there once again for me … i tried to do what your said but im getting “Error executing code” object not initialised Stack trace: [0: 111] \Procedures<Global>\MTMethod [0: 111] \Forms\MPBReasonsInterview\Methods\Close [0: 70] \Classes\SysSetupFormRun\Close In the close method of MPBReasonsInterview i attempted to call a test method in MPBInterviews method like the one below ? parm1 = “Theo”; parm2 = “Boukouvalas”; element.args().caller().MYMethod(parm1, parm2); I have a feeling that element.args().caller() is not pointing to the form calling MPBReasonsInterview. Can it be that im not putting in some code in the lookup method within the form calling this MPBReasonsInterview Lookup form ?

How do i access the _p1 value thats passed to super(_p1). Can it be directly access from the form calling the Lookup form or is it only available in the lookup form to be used with a method like the one recommended but you above.

Ivan figured out… ive included the code for others who might ask such a question on lookups and argument passing between forms. Lookup on a control within the Calling Form (MPBInterviews) public void lookup() { FormRun newPopup; Args argForm = new Args(); ; argForm.name(formstr(MPBReasonsInterview)); argForm.parm(“FRAME::BORDER”); argForm.caller(element); newPopup = classfactory.formRunClass(argForm); newPopup.init(); this.performFormLookup(newPopup); } Lookup up form (MPBInterviewReasons) public void init() { super(); // specify what to return on screen when reason is selected element.selectMode(MPBReasonsForInterview_InterviewReason); } public void closeSelect(str _p1) { super(_p1); // getReasonsFormLookup is a method in the calling form // MPBInterviews, i use this to pass the Reason ID element.args().caller().getReasonsFormLookup((_p1)); } getReasonsFormLookup method in the calling form (MPBInterviews) void getReasonsFormLookup(MPBInterviewReason parm1) { MPBReasonsForInterview reasonsTable; MPBInterviewReason reason; reason = parm1; select firstonly reasonsTable where reasonsTable.InterviewReason == reason; MPBInterviewsScheduled.InterviewReasonID = reasonsTable.InterviewReasonID; } // With this method im seeting ID in a table.

Hi… How to add two tabs in an look up? In first tab it should produce list of matched items and in second tab it should produce all items in lookup.