Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to smooth scrolling in combo boxes??

Status
Not open for further replies.

Gustavson

Technical User
Nov 2, 2001
105
US
Here's the problem: I have a combo box with a scroll bar on a form. My list is fairly large (2000+ entries). For some reason, when I start scrolling from the top of the list, the scroll is not smooth. But, once you reach the bottom of the list, you can grab the scroller and move it up and down smoothly.

Anyways, for some reason, it can't be done from the top of the list. It only scrolls in chuncks. It's very annoying because you have to scroll down to the end of the window, let go, grab and repeat until you reach the bottom. Once the bottom is reached, it scrolls up and down with no problems. Is there a way to fix this problem? I hope I gave you enough info on this...
Thanx
gustavson
 
I think it's inherent in the control whenever you are returning large amounts of query data to it. It seems like before all the values have returned it caculates the relative position of the scroll position indicator and so on and so on. I doubt if there's much that can be done for that. I'd be glad to hear from someone else if there's fix for it. I started out with nothing, and I still have most of it.
 

Scrolling will be less smooth while the combo box loads the record set. Once you go to the last record, all records will be loaded and the scroll will be smoother.

You could add code to the form load event to go to the last entry in the combo box and then back to the first entry. This may cause some performance lag on the form load but should improve scrolling.

Example code:

Private Sub Form_Load()
Me.Combo0 = Me.Combo0.ItemData(Me.Combo0.ListCount - 1)
Me.Combo0 = Me.Combo0.ItemData(0)
End Sub Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Terry:

Would you have a similar solution to this same problem with a sub form?

The underlying table has thousands of records and the subform displays only those pertaining to a specific client (selected in a combo on the main form).

I'm experiencing the same slow scroll response in the subform.

Thanks.
Larry De Laruelle
larry1de@yahoo.com

 

If scrolling slowly or erratically is an issue, I'd try that same solution in the sub-form. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top