By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,296 Members | 1,723 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,296 IT Pros & Developers. It's quick & easy.

Positioning in a field

100+
P: 453
I'm having a problem positioning the cursor in a field. When I click into the field it doesn't start at the beginning, instead it starts in position 1 not 0. If I tab into the field then it starts in position 0. This field has a drop down list and if you click into the field and start typing the name it will not jump to that person. If you click into the field backspace then start typing the name it jumps right to it. I have this code
Expand|Select|Wrap|Line Numbers
  1.  me.cmbalias.selstart = 0 
in the got focus and also the on enter events but neither works.
Any body got any ideas
Nov 21 '11 #1
Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,707
You ask about the possibilities related to the design of your control (not field), but you give us no information about how you've designed it. I suggest you take a close look at some of the properties and, if you still need help, post the required information for the question.
Nov 21 '11 #2

Expert 100+
P: 446
Tom
If you use the mouse and click in any field (control) the insertion point will be exactly where you click, whether it's a TextBox or ComboBox.

The On_Click Event is not recognised by a ComboBox. Try popping a MsgBox from a Click event. Works in a TextBox but not a Combo.

Double Click does work in both and selects the whole of the current entry. If you start typing then (in a ComboBox) you should start matching data.

I suspect a double click is what you need.
S7
Nov 21 '11 #3

100+
P: 453
Thanks for the reply, I've been playing around with this and found what I was doing wrong. I was clearing the combo box using a " " instead of a null and of course this left a space in the field. Thanks for help If I run into anything else I check back.
Nov 21 '11 #4

NeoPa
Expert Mod 15k+
P: 31,707
That's a good point to note Tom. Generally, controls which are empty are represented by Nulls, rather than empty strings (and spaces are a separate and dangerous alternative that should be avoided). The only exceptions I'm aware of are bound controls, and then only those bound to fields which allow empty strings (even then I'm not sure the value of the control would ever reflect that rather than a Null). In short, it's nearly always a Null that indicates a control is empty.
Nov 21 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.