Sorting in a ComboBox

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi! Thanks for helping! I was wondering how I could have a
combobox sort in an order otherthan the key the field is
attached to the form with. I would rather sort by the
business name instead of the unique key attached to the
field. But I also don't want to have the sort in the
combobox Recordsource property because it sorts everytime
I want to look something up which takes a long time with
450,000 records.

Thanks for your help!

Michael
 
Thanks for your reply. The RowSource accepts all 450,000
perfectly fine. The user typically enters the name of the
business they are interested in and that pops up. In the
event it doesn't or autofills with a different value, they
could look up the other fields AROUND the one that is
close. That's the idea. Let me know if you think of a
better idea.

Thanks!
 
I haven't got any Table that big to test the RowSource at present but I
distinctly remember the RowSource stops at 64K rows and there were questions
asking why not all records show up in the ComboBox with a huge number of
rows.

Are you sure the ComboBox shows 450K rows? It will accept the Query
returning more than 64K rows fine but it won't show more than 64K rows.

Suggest using a OptionGroup with 26 ToggleButtons for A-Z. The user can
select a starting letter and your code will populate the RowSource of the
ComboBox with names that has the selected starting letter. This way, you
don't have a huge number of rows for the ComboBox. Sort by name will be OK
but make sure you index the name in the Table.



Stephen Lebans (www.lebans.com) has some code to use a Label Control to do
the same as the OptionGroup.
 
Back
Top