Set Focus

R

Roger Bell

I have an event procedure (Me.fieldname.setfocus) "After Update" in a field
so that when the user changes the contents, the cursor will remain in the
field. Unfortunately, this does not work, as when the user presses the enter
key, the cursor moves to the next field in the Tab order.

Is there any way one can get the cursor to remain in this field, until
another action is performed?

Thanks for any help
 
M

MikeJohnB

One way:

Place an unbound Text Box on your form adjacent to the control you want to
retain focus. set its width property to zero making it not visible to the
user. (Do not set its visible property to No because it must be able to
accept focus)

You will then see your new text box in the Tab Order. Move the text box tab
order to behind the control to retain focus so that it becomes the next
control to accept focus.

In the text box on got focus event, set focus back to the previous control.
Me.PreviousControl.SetFocus

Now whenever the user presses enter, the same control will appear to retain
focus until the user clicks out of the control.

I hope I have explained this well and it helps you???

Kindest Regards
Mike B
 

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

Similar Threads


Top