Update a file - writing to a file

I still cannot understand why the following function will not write the change to my program correctly. For my other functions (add a record and delete record, it wrote all the records perfectly to the file, but for some reason when I go to update a record it does not do this. Someone said it could be my seekg but I don't understand why it worked before but not on this function: