Field with automatic action after reading a barcode

Hello,
i have a control app with a text field and a php button.
I would like an automatic action after reading a barcode in the text field:

the focus is in the text field, i read the barcode with an id value and a return (from the codebar reader)
the focus moves to the button with the execution of the click and of he php code
after the focus come back to the text field with a new null value ready for another barcode

How to do this ?

Regards
Gianpaolo

Open the same window again in insert mode…

A quick quote: For that a form starts by insert mode, should use the macro in onApplicationInit event, with the following configuration:
sc_apl_conf(“meu_formul?rio”, “start”, “new”);
This way, the form application will starts on the insert mode.

Thanks to https://support.scriptcase.net/index.php?/Knowledgebase/Article/View/317/33/open-a-form-in-insert-mode