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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I get a combobox to scroll to a specific item in VB code?

Status
Not open for further replies.

BitTwiddler

Programmer
Mar 13, 2001
8
US
I have a combobox with several columns and lots of records. I want to be able to cause the combobox to scroll down to a specified record in VBA code. I have looked throught postings and some come close to being like what I want but none directly address this trick. Can anybody help me? Please and Thanks from BitTwiddler
 
All you have to do is assign the desired value of the bound column to the combo box's Value property (the default property). When you drop down the list, the matching entry will be selected and the list will be scrolled to make it visible.

If I didn't understand your problem, please rephrase it. Rick Sprague
 
Thanks again Rick. I guess I should have known that already. It worked like a charm. Now the users can click little buttons with the letters of the alphabet on them and zoom to the first list item starting with that letter. The list usually has around 2200 items and this trick will speed-up scrolling up and down looking for items.
 
Thanks,
 
BitTwiddler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top