开发者

MS Access 2003 prevent select all text on focus

开发者 https://www.devze.com 2023-03-22 23:13 出处:网络
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.开发者_如何学CThe problem is that I cannot get the Text.SelStart, or any other

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. 开发者_如何学CThe 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?


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.


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.


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.

MS Access 2003 prevent select all text on focus


(source: flylib.com)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号