Open new user and add in the form

In the form (form_example) I have the button Add new user.
When I add a new user, and press the Add new user is added to the user database. (form_user)
After press the exit, go back to the initial form (form_example)

But I would like to add its data automatically in the form (form_example) from which I opened, add new user.
And returned to the original form if possible as soon as I press Add. No pressure on Exit.

Can someone please help with explaining how to do it. Or better yet maybe a code example.

thanks in advance

in the onafterinsert event do a sc_committrans(); then a sc_redir to the original application.

Albert thanks for the reply. Or you may be a little more specific.

In my case I have a in user form fields: id, name, address, phone

In form_example I want to insert only the name and phone
field name = text auto complete and is the same as the user id from table

So I have from one form to another to provide:
id = name
phone = phone

I do not know how to send as parameters or global variable.

Thank you.