Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Combo Box / Auto Expand (Access 2002)

    I couldn't fiind any help via search, hence this post.

    I've a combo box with dropdown fired when the control receives the focus. I also have AutoExpand set to true. When the user tabs into the control, the current value is highlighted and the drop list shows. With the current value highlighted the user can also begin typing a new value. However, when the user clicks on the field (rather than tabbing) the current value is not highlighted and it is awkward for the user to change the value via typing. Thus far I've not been able to figure out how to highlight the current value when the control receives the focus via mouse.

    Thanks for the help,
    Marty

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box / Auto Expand (Access 2002)

    Tell the user to click on the label from the combo instead of on the combo itself
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box / Auto Expand (Access 2002)

    I don't think it's easy to change this behavior. You can provide an accelerator key, so that the user can set focus to the combo box from anywhere on the form - precede a character in the label attached to the combo box by an ampersand &. The character will be underlined in form view, and the user can press Alt+character to set focus to the combo box. Teach your users to either use Tab or the accelerator shortcut.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Combo Box / Auto Expand (Access 2002)

    Thanks for your suggestion. I failed to mention the combo is on a sub form which is in datasheet view mode. I've got it covered if they click on the record selector. I was hoping someone would know of a way when the user has clicked in the combo box. I guess I will just have to train the user.

    Thanks again.
    Marty

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo Box / Auto Expand (Access 2002)

    I use the following code to achieve what you want.

    Private Sub ComboTeacherName_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me!comboTeachername.SelStart = 0
    Me!comboTeachername.SelLength = Len(Me!ComboTeachername.Column(1))
    End Sub

    I haven't tried it in datasheet subforms, so I am not sure how it goes there.

    The downside is that if you click the drop down of the combo box, the list collapses immediately. Click it a second time and it stays down.

    If you have the combo set to dropdown when it gets the focus, this no longer works, but this then means that it does then dropdown the first time you click the drop down arrow.
    Regards
    John



  6. #6
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Combo Box / Auto Expand (Access 2002)

    Thanks for the tip. I'll play with it and then decide what set of trade offs seem to work best for my user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •