So whenever i try a MODIFY i get the error " "Table.Field" 'NEW_VALUE' does not exist " seems like it tries to find the record with the new primary key value which obviously doesn't exist yet in the table... so how am i supposed to change the value of the primary key field then? Do i have to delete the old row and insert a new one? seems weird to me.
0
Answers
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
NewRec = OldRec
OldRec.Delete;
NewRec.PrimaryKey = NewValue
NewRec.Insert;
There's a reason it "took long time" - it also needs to look up all related records (where Table Relation is pointing to the field you're changing) and modify values there as well. Imagine renaming Country or Currency without changing all the instances of them on related tables - it would be chaos!