[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Using data from a previous record for a new one (OpenInsight Specific) ==== === At 13 NOV 2000 05:20:50PM a becker wrote: === {{tag>"OpenInsight Specific"}} We have the following situation: Record on file 3 part key. The last key field indicates the latest record. User wishes to have a new record and keep the data that was in the last record, changing only what is necessary. Example Record 1, yr 01, revision 1 is the latest record. User wishes to create Record 1, yr 01, revision 2 and have the information that is in revision 1 to be automatically in record 2, allowing them to make whatever updates are necessary. Whenever we change the revision key, the record is blanked out. In AREV I am told, there was an ALT-C that copied the contents of the previous record displayed and ALT-O that did the same for an individual field. Anything like that in OI? Thanks for your help. ---- === At 13 NOV 2000 06:15PM Donald Bakke wrote: === If you don't mind digging through links, here is one [url=http://www.revelation.com/WEBSITE/DISCUSS.NSF/f12696d31000b22a8525652b00831bb2/0397d67659098c6c852567b4007eb84d?OpenDocument]post[/url] that Cameron made that should be helpful. dbakke@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/srpicon1.gif[/img] ---- === At 13 NOV 2000 07:03PM Scott, LMS wrote: === Hi A I assume you are entering data on a form. What we do is to put the current record into a hidden control (which doesn't have a database association) for the old record when it gets saved. eg after it is saved can use old_rec=xlate(filename,key,'','X') then set your hidden control: .oldrec-]text=old_rec Then when you read in the new record (this is what happens when you change the key, you can write code on the read event to assign all the controls from the old record saved in the hidden control. It doesn't seem to matter if you have field and value marks assigned to an edit box (for example). Use forward_event() in the form write and read event to control code before and after the actual write or read You would probably need a separate hidden control for the old key, and you could test on the read event for 1. is there an old record 2. is the key of the old record of the same parent ie are the first two parts of the key the same then if 1 and 2 ok, assign all the relevant controls. You might even be able to set @RECORD=.OLDREC-]TEXT but I find that a bit unreliable. We use unbound hidden controls as a sort of common store between records a lot. It is very handy for storing things like batch numbers and batch totals, when you are entering transactions in the same batch, or default stuff, where you want to have fields automatically filled with previously entered info. Well hopefully that makes enough sense to be useful. Scott [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=07C288DC8344265485256996007AC1DF|View this thread on the forum...]]