In this step, you will modify your existing Search by Department Description form to include the predetermined join column Total Salaries. This field will show the total salaries for all employees in the department.
1. Using iiiLIST tab, locate and open form iiiSearchDeptByDesc.
2. Drag the field iiiTotalSalaryPJC to the form.
3. Switch to the Source tab and modify the FETCH command and change the Fields() parameter to *ALL.
Fetch Fields(*ALL) From_File(IIIDEPARTMENTS) With_Key(#IIIDEPT)
This is a quick fix. A better solution would be to define a Group_By for the required fields and reference this in the FETCH statement.
Since this is a display only field, you would also change its ReadOnly property to True.
4. Compile your form. Check that the compile completed successfully.
5. Execute your form.
a. Fetch the Administration department.
Notice the value for the predetermined joined column Total Salaries. It shows the combined monthly salaries of all employees in the Employee table for the department you retrieved.
6. Close the form and close it in the editor.