Positioning in a field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CD Tom
    Contributor
    • Feb 2009
    • 495

    #1

    Positioning in a field

    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
    Code:
     me.cmbalias.selstart = 0
    in the got focus and also the on enter events but neither works.
    Any body got any ideas
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    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.

    Comment

    • sierra7
      Recognized Expert Contributor
      • Sep 2007
      • 446

      #3
      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

      Comment

      • CD Tom
        Contributor
        • Feb 2009
        • 495

        #4
        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.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          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.

          Comment

          Working...