cmdAdd.click code modified scatter memvar memo dodefault() if this.parent.editmode * m.primaryfield = m.newkeyvalue && Change primary key value gather memvar memo thisform.refresh endifBut beware it plays with set("fields") so ensure that you at least change the unique id values (primary key field).