Faster Combobox

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi

Is there a way to speed up the combo. I have one that is sourced from a
saved query and has 3 columns with around 9,000 records. It takes around ten
seconds to open.

Thanks is advance

Richard

--
 
First off you should consider whether there is another control that could be
added that would be used as criteria for limiting the number of records
returned in the combo. Since 9,000 records is quite a few to scroll through
you might want to add an unbound control that is strictly used for this
purpose.

Another way is to limit the number of rows returned by the rowsource query.
One way to do this is to use the typed contents of the combo as a filter for
the rowsource. Then when I open the combo, I have to start by typing
something - if I type "C", the combo is filled with records starting with
"C".

Here's some sample code -

Private Sub Combo45_Change()
Me.Combo45.RowSource = "SELECT Customers.CustomerID, " _
& "Customers.CompanyName " _
& "FROM Customers " _
& "Where CompanyName like """ & Me.Combo45.Text & "*"" " _
& "ORDER BY Customers.CompanyName;"
End Sub
 
Back
Top