January 3, 200323 yr I would like to do a running inventory database. It would be helpful to advance the (calculated) current item's inventory balance from the "Onhand" field (x) to a balance forward field (y) that is used by the "Onhand" calculation along with credit and debit information when duplicating the record. Balance + Credit - Debit = Onhand When duplicating, I am using a script that dups, sets fields to 0 and I need to auto enter the old Onhand amount into the new Balance field. I have tried "Insert from last record" step without success. Any help.
January 3, 200323 yr Make a Balance Global field, gBalance. In your dupe script, add a Set Field command before the dupe step that will set this global field with the contents of the Onhand field (of the old, as-yet unduplicated record). Then the script dupes & sets to zero as you outlined. Finally, add another Set Field command that will set the Balance field (of the new duped record, assuming this record is the active record at this moment) with the contents of the global. You could neaten up by setting the global itself to "" as a final step, but if you are careful about using this field, it shouldn't matter. You could leave your global field stashed on some working layout, an All Fields layout, so it isn't visible during your work. The Set Field command does not need to have the fields available in the current layout to work (unlike Replace). Steve Brown
January 4, 200323 yr Author Thanks, this was the solution I needed and provided added insight. Thanks for responding
Create an account or sign in to comment