How to search for an item in the rows of a listbox

  • Thread starter Thread starter Paul Brown
  • Start date Start date
P

Paul Brown

Hi,

Is it possible to search for an item listed in a combobox
using a VBA code?

For example, I want to search for the existence of an ID
in the list portion of a combobox using a code and return
a result if it was found.
 
What is the combo box's RowSource? If it is a query or table, you could simply do a
DLookup call on the same table or query and see if the value exists.

Yes, it is possible to step through the items in the RowSource. Check the Column property
of the combo box. Also, the ListCount property will tell you how many items there are so
that you will know how many to loop through.
 
Back
Top