Movement through a form with Tab and Enter key movements

C

Charles D

Hi,

I have a form that has the movement between fields with the Tab key as
required. When the Enter key is used it moves to a field that is not in the
same sequence as the Tab key and not the field I would like to have the
focus. I have tried setting the On Exit and On Enter events to set the focus
on the desired field (text box). But the focus is on another field (Combo
Box).
 
T

Tom van Stiphout

On Fri, 3 Apr 2009 05:52:01 -0700, Charles D

It is often counter-productive to try to offer a non-standard user
experience. Tab is used to move from field to field, and Enter to push
the default push button (often the Save or OK button), and Esc to push
an alternate push button (often Cancel).

-Tom.
Microsoft Access MVP
 
C

Charles D

Hi,

Thanks for the reply. I did a trace on Exit event of the textbox I want to
heve the focus. This tells me that the textbox has focus initially, but an
event forces it to move to the another object on the form. The following
events are active on the textbox I want to have focus are:
On Change
On Key Down
On Key Press
On Enter
On Exit

Regards,

CharlesD
 
M

Mr B

First, try going to Tools/Options to display the Options dialog box. Click on
the Keyboard tab and check with option is selected for the "Move after enter"
opton group.

Make sure the "Next Field" options is selected and see if that helps.

If not, if I understand you correctly, you have an event proceedure on each
of the events that you listed. I would try adding the following to the On
Exit event of the control that has the focus just prior to the control that
you want to have the focus.

Me.NameOfControl.SetFocus

I may not be understanding the complete problem here. Is the same record
being displayed or is the next record being displayed when the Enter key is
pressed? I am concerned as to why you are getting the movement of the cursor
the way you are.
 
C

Charles D

Hi,

I am not moving from one record to another. I am moving between objects
within the form. Your suggestion to add the following:
Me.NameOfControl.SetFocus
has solved my issue.
Thanks,
 
M

Mr B

I am very glad to hear thay something worked.

I was afraid that the setting from the options dialog box had gotten changes.

Good luck with your project.
 

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