Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Oct 2005
    Location
    Kansas City, Missouri
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box - show contents on focus (2000)

    Im sure this has been asked before, but for the life of me when I search on this, I cant find what Im looking for. My guess is, I'm not using the correct verbiage when searching.

    I would like to code my combo box so that when the cursor focuses on the control, it will automatically drop open and I can choose a value from the list. Also I would like to exand the list (not the physical control) to combined width of the columns. Any suggestions gets you a cookie of your choice! <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

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

    Re: Combo box - show contents on focus (2000)

    1. You can use the (surprise! surprise!) Dropdown method of the combo box in the On Got Focus event, for example for a combo box named cboEmployeeID:

    Private Sub cboEmployeeID_GotFocus()
    Me.cboEmployeeID.Dropdown
    End Sub

    2. You can set the List Width property of the combo box to the desired width (i.e. the sum of the widths of the columns, plus a little bit) in design view.

  3. #3
    Lounger
    Join Date
    Oct 2005
    Location
    Kansas City, Missouri
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box - show contents on focus (2000)

    Thanks Hans,

    I thought it would have something to do with the got focus event, but just didnt know how to code it.

    <img src=/S/hugs.gif border=0 alt=hugs width=41 height=25>

    I have a cookie with your name on it Hans!

Posting Permissions

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