Normally this king of functionality is achieved easier if you put your form in a detail region and populate its data from the detail region.
So when the detail region is set to a record, the forms has data, when it is set to empty record you get an empty form for insert.
And at the end of the form you have two submit buttons - one for update and one for insert and you toggle their visibility depending if you have record or not.
So this way you gave a nice combo of insert and update form in one.
The detail region has actions for setting the active record or clearing it.
Not sure if we have a tutorial for this one but it will be very useful @Teodor