Jump to content
Sign in to follow this  
Squall_FF8

TDBLookupComboBox without the field: DataSource

Recommended Posts

Posted (edited)

Hey Guys,

I have a TDBLookupComboBox with all properties set up to show proper info in the DropDown - ListSource, KeyField, ListField. It links to a query that has ID and Name fields.

Is it possible to select the appropriate Name, based on an ID, without using a DataSource (the field)? If so - how to do that by code?
An example, I have ID = 100, I want the Name with that ID to be select by the combo.

Edited by Squall_FF8

Share this post


Link to post

Try to set the KeyValue property to the ID you want to look up.

Share this post


Link to post
On 3/19/2025 at 1:03 PM, PeterBelow said:

Try to set the KeyValue property to the ID you want to look up.

Great, that is exactly what I needed, Thank you!!
 

It works to set the selected item, but also to check what Item is selected.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×