 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bill N Guest
|
Posted: Thu Jan 29, 2004 2:24 pm Post subject: How to Use TDBCombobox |
|
|
I want to list the descriptor field but return the index field of the selected item in a combobox. Is there a way of doing this with a TDBCombobox?
I could iterate through the query and add items to a TCombobox and use AddObject to add the integer key and on the selected item I could retrieve that value but isn't there an easier way.
Thanks,
Bill N
|
|
| Back to top |
|
 |
JohnE Guest
|
Posted: Thu Jan 29, 2004 11:19 pm Post subject: Re: How to Use TDBCombobox |
|
|
| Quote: | I want to list the descriptor field but return the index field of the
selected item in a combobox. Is there a way of doing this with a |
TDBCombobox?
I use a TDBLookupComboBox to do as you describe. Set the ListSource,
ListField and Keyfield properties. To check which keyvalue has been
selected simply read the DbLookupCombobox.Keyvalue property. The control
does not need to be bound to a Datasource or Datafield in order to work.
This will work provided your key value is in the same table as your
description field.
HTH,
John
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|