Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Search Functionality to select a specific record in a Listbox

Status
Not open for further replies.

dleiba

MIS
Aug 22, 2001
28
JM
Greetings,

Here is my dilemma.

I have a form with a listbox on it. The listbox is unbound and has a Query set as its data source.

Presently the number of records being displayed is not large. However, I know that as the database grows so too will the records being displayed.

I have therefore decided to build some sort of "Search" function into the form. The default search function does not work.

What I need is this:

When specific search criteria is entered, the record relating to this criteria is located within the listbox and displayed. If not, an error message is generated.

Suggestions will be greatly appreciated.

Thanks,

Dominic >:):O>
dsleiba@capital-credit.com

 
Try this:

For i=0 to me.ListBox.count-1
listbox.selected(i)=true
if me.listbox.column(x)=SearchCriteria then Exit For
Next

If you search in the column other then the bound column use the column(x) property, where x = the number of column - 1.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top