counter number row in child form

counter number row in child form

Hello everyone , I need your help: I would like to enter into a numeric field a row count of a child form that start at zero for each record inserted had tried with some scripts found in the forum but the count is not reset and continues for all the rows inserted for each record .
suggestions ? ideas ? thanks a lot