devxlogo

DBLookupComboBox

DBLookupComboBox

Question:
Can the drop-down items for a DBLookupComboBox be populated from the results of a TQuery?

Answer:
Yes, a query can act as the data source for a TDBLookupCombo. You just needto place a TQuery on your form, set a TDataSource’s DataSet property to thename of the TQuery, then set the TDBLookupCombo’s DataSource property to theDataSource.

Set up the query with the proper SQL, run your program, then run the query.Once the query’s finished, you’ll have to specify which field of the TQuerywill be acting as the ListField.

devx-admin

Share the Post: