How to make submit button perform two actions, save and edit

Hi,
I am trying to create a form where the first time a user access it saves
the fields. Then the subsequent time the user accesss the form it edits.