Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Combo box scroll problem (2002)

    I have a drop-down combo box on a form used to select a record. When I clidk on the down-arrow the list appears with a scroll bar. However, dragging the slider downward doesn't scroll the list (it jumps when I let go). If I drag the slider to the very bottom of the list, the list all of a sudden starts scrolling in the normal fashion.

    Is there some way I can cause the slider to scroll normally when I first open up the list without having to go to the bottom?

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

    Re: Combo box scroll problem (2002)

    For efficiency reasons, a combo box does not load all items when the form is opened or even when the dropdown list is opened the first time, only the first items are loaded (I don't know the exact number.) If the number of items is larger than the number that is pre-loaded, the combo box does not "know" how many items there are, so the scroll bar doesn't work correctly yet. The scroll bar will start to work correctly when the last item has been loaded.

    The recommended solution is to avoid using combo boxes with a very large number of items; instead, use two or more combo boxes that let the user drill down in steps. But if you wish, you can force the number of items to be read when the form is opened. Add the following lines to the On Load event procedure of the form:

    Dim lngCount as long
    lngCount = Me.YourComboName.ListCount

    where YourComboName is the name of the combo box. This suggestion is from Stephen Lebans.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo box scroll problem (2002)

    Hi Hans,

    Thanks, the code works. I haven't noticed any effect on efficiency (if effeciency = speed). The application works great.

Posting Permissions

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