Trigger an error message when user tries to modify a record that doesnt exist

You basically asked the same question and got an answer 6 months ago:
Displaying error message when user tries to delete something that doesnt exist in DB?