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

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.
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top