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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I select items in a DBLookupListBox?

Status
Not open for further replies.

Wings

Programmer
Feb 14, 2002
247
US
Hi,
Does anyone know how to select an item in a DBLookupListBox
through code? I want to type something in an edit box then after pressing a button, have the DBLookupListBox highlight the item in its list that matches the edit box contents.
There will always be a match in the list by default.

If anyone has any ideas, the help would be greatly appreciated.
 
I have the same problem recently. I have not found anythink about this problem. I think that you can use DBGrid and make it look like DBLookupListBox from his property OPTION
(excuse me for the bad English.)
 
compare each item in the source table to the edit->text.
if there is a match the RecNo will be the correct
matching item.

for loop thru table
{
if (strcmp (Edit1->Text.c_str (), Table1->Fields [x]AsString.c_str () ))
break;
}

the record that is active will be the matching record. Of course there
should be some checking for no matches found I'll leave that tweaking to you.

DBLookupListBox has a source table. You canselect an item by selecting a table record.

Hope it helps.


tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top