How to keep arrow keys inside a field?

L

LurfysMa

I created a simple form using the wizard for data entry in a table. I
ma having a problem in that the arrow keys don't stay inside the
fuield, but act like the tab key by going from field to field and even
to the command buttons.

I have two data entry fields: Question and Answer. They both have
vertical scroll bars in case the data is too large.

If the cursor is in the Answer field and I use the right arrow key,
when I get to (past) the last character, the next press of the right
arrow key goes to the Question field.

How can I force the arrow keys to stay within a field?
 
E

Ed Robichaud

On the menu bar, use "Tools-Options-Keyboard" and set the "Arrow key
behavior" to "next character"
 
L

LurfysMa

On the menu bar, use "Tools-Options-Keyboard" and set the "Arrow key
behavior" to "next character"

It is already set that way. The options on that screen are:

Move after enter: Don't move
Behavior entering field: Select entire field
Arrow key behavior: Next character
Cursor stops first/last field: Unchecked

I changed some of the other options (Behavior entering field) and they
do take effect. The Arrow key behavior does not.

Coud I have set some Property option in the form by mistake?

PS: This is Access 2000 SP-3
 
L

LurfysMa

On the menu bar, use "Tools-Options-Keyboard" and set the "Arrow key
behavior" to "next character"

After experimenting with that option, I'm not sure it's the right one.
It seems to control the behavior on each instance of the arrow keys.
With it set to "Next field", the arrow keys jump to the next field
even if the cursor is in the middle of the current field.

I tried checking the "Cursor stops at first/last field", but no joy.

What we need is a "Cursor stops at first/last character" option.

This is Access 2000, SP-3.
 
E

Ed Robichaud

What you describe is "normal" behavior of Access navigation. The user is
expected to <Tab> from control to control. You set the Tab Stop property of
each control to "No", but either the Tab or Cursor keys would move to the
next control who's tab stop is set to "yes"

You could work with the key codes of the arrow keys

vbKeyLeft 0x25 LEFT ARROW key
vbKeyUp 0x26 UP ARROW key
vbKeyRight 0x27 RIGHT ARROW key
vbKeyDown 0x28 DOWN ARROW key

(from Access VBA Help)

and write a little code to limit the response to key down property of each
control, but again the typical Access behavior is to select the entire
control contents (on enter) for data entry or overwriting, not cursor
editing within the control.

-Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top