stop creating a new record while clicking on enter on any field in a journal?

when I am filling all the mandatory fields in a particular journal and clicking on enter by keeping cursor on any field, a new journal is getting created and the old journal is getting saved. how to overcome this scenario???
Thanks in advance

there was some customized code it seems in task function

if (p1 == #taskEnter )
which was the reason it was generating new line