EnterKeyBehavior Property

EnterKeyBehavior Property

See Also                  Applies To

You can use the EnterKeyBehavior property to specify what happens when you press ENTER in a text box control in Form view or Datasheet view. For example, you can use this property if you have a control bound to a Memo field in a table to make entering multiple-line text easier. If you don't set this property to New Line In Field, you must press CTRL+ENTER to enter a new line in the text box.

Setting

The EnterKeyBehavior property uses the following settings.

Setting Visual Basic Description
Default False (0) (Default) Microsoft Access uses the result specified under Move After Enter on the Keyboard tab of the Options dialog box, available by clicking Options on the Tools menu. For details, see the Remarks section.
New Line In Field True (–1) Pressing ENTER in the control creates a new line in the control so you can enter additional text.

You can set this property by using a form's property sheet, a macro, or Visual Basic.

You can set the default for this property by using the control's default control style or the DefaultControl method in Visual Basic.

Remarks

The following options are available under Move After Enter on the Keyboard tab of the Options dialog box.

Option Description
Don't Move Pressing ENTER has no effect.
Next Field Pressing ENTER moves the insertion point to the next control or field in the form or datasheet in the tab order.
Next Record Pressing ENTER moves the insertion point to the first control or field in the next record on the form or datasheet.