More precisely, in Base, is it possible to save in the table associated with a form data entered in a field of this form by using the key Carriage Return or Enter Key after the entry?
IMHO not directly, but you can call a macro, when a field was changed. This macro could save the record.
.
Normally data is saved, when you go to the next recordâŚ
⌠and: There might be fields where entry is required. So you will run into an error when âEnterâ will save the data of a new row and there is missing content in other rows.
You will get âEnterâ in a macro by
SUB SaveReturn(oEvent AS OBJECT)
IF oEvent.KeyCode = 1280 THEN
âŚ
END IF
END SUB
Macro should be bounded to event âKey pressedâ.
Add a push button with action âsave recordâ or ânew recordâ.
Make this button the default button.
âTake focusâ: False
You may also hide the button. It will be triggered anyway.
Thank you all for taking the time to answer my question.
.
The simplest solution and which avoids having to write and use a macro is that of Villeroy. It works really well and I see some advantages in it such as switching between fields, selections and records using these two keys. With a well-established activation sequence, they become navigation keys in the active record and in the form. Very interesting.
.
However, wouldnât it be rather logical and interesting to be able to select this action of saving the current record (involving these two keys) in an âActionâ item of the General tab of the text box properties, as is the case for a button where the user has the choice to use this option or not? Would implementing such an option for the textarea field cause a problem?