EnterKeyBehavior Property

Applies To

Text Box Control.

Description

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 the EnterKeyBehavior 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

Description

Visual Basic

Default

(Default) Microsoft Access uses the result specified in the Move After Enter option on the Keyboard tab of the Options dialog box, available by clicking Options on the Tools menu. For details, see the Remarks section.

False (0)

New Line In Field

Pressing ENTER in the control creates a new line in the control so you can enter additional text.

True (-1)


You can set this property in the control’s property sheet, a macro, or Visual Basic.

You can also set this property using the control’s default control style.

Remarks

If you set the EnterKeyBehavior property to Default, Microsoft Access uses the setting for the Move After Enter option on the Keyboard tab in the Options dialog box, available by clicking Options on the Tools menu. The Move After Enter section has the following settings.

Setting

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.


See Also

AutoTab Property.