Hi Heinz,
There are ways to get your code run only once on the opening of a form (either Insert, Change, Delete, Copy or View).
A simple way is to use the PreInsert/Update/Delete embeds and call a routine, say Start_Code, at each point you need it (usually just PreInsert and PreUpdate.
Another option is to run a check in the InitForm embed, to make sure the code only runs once:
if (p_web.GetValue('FORMNAME_form:inited_') = 0)
Hope that helps.