Javier, Thank you for your detailed response. I will have a closer look at your approach shortly. In the mean time I have done some more investigations into what is happening on the form I have been using and find that while the EEPs I am using update the SCHED table, when I move to the next row the values are not the same. Using a select seqno,ulab,umatl on entry into a DB Grid, which is part of the form the following happens:- (most of this is from various write statements within the EEPs I was using to see what is happening)
R>edi usi sc order by itemno subitem �seqno����� ulab���� umatl���������� �---------- -------- --------------- ������ 4996����� 4.2�������� $111.90 ON CLICK EEP �Columns have been updated in 1 row(s) in sched �Columns have been updated in 1 row(s) in sched ulab# =� 6.���� � ulab# and umatl# are the variables �returned� indirectly from the ComboBox umatl# =� $91.00 seqno =� 4999�� - unique identifier for the row in question umatl in sched= $91.00 � value in the SCHED table after the update ulab in sched= 6.����� � ditto for labour END OF ON CLICK EEP ON EXIT EEP on exit ulab =� 6.���� � values still the same on exit umatl= $91.00 exited AFTER TABLE REFRESH on exit ulab =� 6. on exit umatl= $91.00 REFRESHED �seqno����� ulab���� umatl���������� �---------- -------- --------------- ������ 4999������ 6.��������� $91.00 �Columns have been updated in 1 row(s) in sched But when I leave the form and retrieve the values from the just updated row I get R>sel seqno ulab umatl from sched where seqno=4999 �seqno����� ulab���� umatl���������� �---------- -------- --------------- ������ 4999������ 0.���������� $0.00 Having tried various combinations of saving rows and refreshing forms and tables, it is obvious that I have something wrong here. If anyone can tell me what, that would be much appreciated. Thank you. Regards, John Docherty -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Javier Valencia Sent: Tuesday, December 14, 2004 1:24 PM To: RBG7-L Mailing List Subject: [RBG7-L] - RE: Updating Column Values From Variables in a Form John: This is how I do it: I have a form with one to many tables, i.e. for each work order-procedure there can be many employees assigned to it When I want to insert a new employee I sue the followingpartial code code: -- Here I select an employee CHOOSE vsel FROM #VALUES FOR + (LJS(slot_no, 8) & LJS(emp_class, 5) & LJS(emp_sname, 20)) + FROM emp_file + UNION SELECT (CHAR(26) & 'Add New Employee...') FROM orgfile + ORDER BY 1 ASC + TITLE 'Employee List' CAPTION 'Select Employee...' LINES 10 FORMATTED IF ( SGET(.vsel,1,1) = CHAR(26) ) THEN � EDIT USING emp_form ORDER BY slot_no ASC � GOTO beg_of_eep ENDIF IF (vsel = '[ESC]') THEN � RETURN ENDIF SET VAR vslot_no = ( STRIM(SGET(.vsel,9,1)) ) -- Here I get imformation for that employee SELECT emp_sname, emp_class, hcost_reg, hcost_ot, fica_mult + INTO vemp_name, vemp_class, vhcost_reg, vhcost_ot, vfica_mult + FROM emp_file WHERE slot_no = .vslot_no -- Here I insert the entire record INSERT INTO fwo_proc_labor� + (fwo_no,proc_code,slot_no,emp_name,emp_class,fwo_labor_date, + hr_reg,hr_ot,hr_2times, hcost_reg, hcost_ot, fica_mult) + VALUES(.fwono, .vproc_code, .vslot_no, .vemp_name, .vemp_class, .#DATE, 0, 0, 0, .vhcost_reg, .vhcost_ot, .vfica_mult) PROPERTY TABLE fwo_proc_labor 'REFRESH' PROPERTY TABLE fwo_proc_labor 'LAST' SKIP TO hr_reg This will put a new record on the screen with the employee name classification and hourly rates that can be edited. If I want to modify this record on entry to the Slot Number (employee ID) field, I have the following EEP: SET VAR vold_slot_no = .vslot_no SET VAR vnew_slot_no = NULL RETURN This is the on field exit EEP: ��� SAVEROW -- Compare the value of slot number on entry vs exit form the field, if it is different slot_no has changed -- and the information will be collected ��� SET VAR vnew_slot_no = .vslot_no ��� IF ( vnew_slot_no <> .vold_slot_no ) THEN ����� PAUSE 2 USING 'Value has changed' + ����� CAPTION 'Status Message' icon confirm -- collect information for new employee ����� SELECT emp_sname, emp_class, hcost_reg, hcost_ot, fica_mult + ����� INTO vemp_name, vemp_class, vhcost_reg, vhcost_ot, vfica_mult + ����� FROM emp_file WHERE slot_no = .vslot_no -- Update current record ����� UPDATE fwo_proc_labor SET + ����� emp_name = .vemp_name, + ����� emp_class = .vemp_class, + ����� hcost_reg = .vhcost_reg, + ����� hcost_ot = .vhcost_ot, + ����� fica_mult = .vfica_mult + ����� WHERE fwo_no = .fwono AND proc_code = .vproc_code AND + ����� slot_no = .vnew_slot_no ����� SET VAR vold_slot_no = NULL ����� RECALC ����� PROPERTY TABLE fwo_proc_labor 'REFRESH' ����� RETURN Note that the work order number and procedure code (fwono, vproc_code) are pre-defined. This should give you an idea of how to collect lookup information and place it into editable fields. Javier, Javier Valencia, PE President Valencia Technology Group, L.L.C. 14315 S. Twilight Ln, Suite #14 Olathe, Kansas 66062-4578 Office (913)829-0888 Fax (913)649-2904 Cell (913)915-3137 ================================================ Attention: The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.� Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all system and destroy all copies. ====================================================== -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Docherty Sent: Monday, December 13, 2004 5:55 PM To: RBG7-L Mailing List Subject: [RBG7-L] - Updating Column Values From Variables in a Form The answer to this question is presumably obvious, but any assistance would be appreciated. I have a form SC, using a table SCHED, with a DB Lookup ComboBox which returns a description, DE from a RATES table into a column DE in SCHED. The rates table also contains another two columns, ULAB and UMATL which I extract into two variables using the ON Click EEP. What I want to do is to update the values of ULAB and UMATL in the SCHED table, while the row is still on the form, so that the user has the ability to edit these. Presumably this is straightforward but unfortunately I cannot sort out how to achieve this. (An update from the EEP does not work, with the resource required not being available.)� If there was a way for a DB Lookup Combobox to assign more than one column from the lookup table to columns in the form table that would be very useful. Thank you. Regards, John Docherty Professional Building Services Limited P O Box 8601, Christchurch. New Zealand. ph: 64-3-3480-873 fx:�� 64-3-3483-628 em:[EMAIL PROTECTED] � -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.290 / Virus Database: 265.5.4 - Release Date: 15/12/2004
