Display limit of combobox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database. in one table 110,000 recorsds, in the
combobox only display 65535 records. how possible to all
records in the combobox
 
You can't. The limit is ~65,000 records. And, if you're displaying that many
records in a combobox you should probably rethink your interface design. Can
you limit the records returned? Are you sure your users need all those
choices? I couldn't imagine having to cycle through 110k records to find the
one that I needed, even with AutoComplete ...
 
To add to Scott's reply - think about adding one or more controls that are
used to narrow down the range of choices for the combo box. These filtering
controls don't have to be bound controls - in other words, their values
aren't saved to the form's recordsource, they are only used for filtering
purposes.

Here is a KB article that will show you one way of doing this (note that it
only synchronizes two combo controls but this is easily extended to include
additional filtering fields):

ACC: How to Synchronize Two Combo Boxes on a Form (97624)
http://support.microsoft.com/default.aspx?scid=kb;[LN];97624

Another 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". Note that with as much data as you have, I wouldn't rely solely on this
method - but you could use it in combination with one or more filtering
controls.

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