Code to update record in table