Ayman
Ayman

Reputation: 11585

MS Access 2003 prevent select all text on focus

MS Access 2003 has to be used, unfortunately.

I need to add a button to do some stuff on selected text in a Text control. The problem is that I cannot get the Text.SelStart, or any other property unless it has focus. When I do Text.SetFocus, all the text is automatically selected.

Is there any workaround?

Upvotes: 1

Views: 3203

Answers (3)

Jacob
Jacob

Reputation: 43259

That is a Access Setting, I don't know if you can change it programmatically. I only have german Access so I'll try to translate the menu to english:

go to Tools -> Options in the menu bar.

On the Keyboard tab, there is a box on the right Behavior entering field.

Access Options Window
(source: flylib.com)

Upvotes: 0

efrench
efrench

Reputation: 11

Not sure how 2003 works, but in Access 2010 go to File/Options/Client Settings/ under the Editing heading, Behavior entering field, select "Go to start of field" or "Go to end of field"...worked like a charm for me.

Upvotes: 1

Ayman
Ayman

Reputation: 11585

The only workaround I found is to bind the action to a key press event on the control. Since the control does have focus, any operation can be done.

Also note that you should probably change the control Value, not Text property.

Upvotes: 0

Related Questions