Move after enter - exception

T

tshates

Move after enter selection on Keyboard Options is set to Next field. In
almost every case on a certain form this behavior applies. In one particular
textbox field, however, only the tab key will advance to Next field. The
field in question happens to be a key in a different table. There is an
AfterUpdate event that pulls information from the table into the form when a
key is entered; for example KEY1 is entered, and the tab key is pressed,
DATA1 is populated in the form and the focus moves to the next field. But if
KEY1 is entered and the enter key is pressed, KEY1 disappears and the focus
remains in the same field. Pressing tab will cause KEY1 to reappear and
focus to move to the next field. So far I have not been able to devise a
workaround for this issue. I am considering disabling the enter key to force
the user to use the tab key in the form. Any ideas?
 
B

Brian

Is the text box bound to a memo field? If so, then it could be just going to
a new line in the same control field. Try stretching the text box height and
trying the Enter key to see if it goes to a new line in the same box. If it
does, then you could either change the underlying field type from memo to
text or use the control's KeyPress event to check for the Enter and either do
a SendKeys Tab or just manually NextControl.SetFocus.
 
T

tshates via AccessMonster.com

Brian,

Good suggestion, thanks. I checked and it is bound to a text field, however
the field size was 255 characters. I shortened the field size and that
solved the disappearing problem. Now when I press enter the item does not
disappear, but the cursor stays at the end of the field. Still the problem
of moving to the next field after enter remains. Tab or right arrow and the
focus shifts to the next field, but after pressing enter, no. This is the
only field on the form that behaves this way. There is another field with a
similar AfterUpdate event on the same form that does not behave this way.
The only difference between the two is that one is the key in its table and
and the other is not the key in its table.
 
T

tshates via AccessMonster.com

Problem solved. The answer is to set the EnterKeyBehavior property for the
textbox to Default instead of New Line in Field.
 

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