Lazarus
Programming => Databases => Topic started by: james on February 22, 2011, 05:36:05 am
-
I'd like to use the subject to add the content of the listsource field to an edit box. There is no datasource/datafield used.
"Caption" isn't the answer. DBLookuPComboBox.KeyField doesn't work. All I get is a field name. What does one use?
-
Hi James,
Something like edit1.text:=dblookupcombobox1.ListSource.Name ?
Regards
-
Thanks for the answer, but that just displays the datasource name...
-
Do you need the selected value of the combo displayed in an editbox?
If yes: edit.text:=combo.text; with the code on combo's 'on change' event.
-
That displays the Listfield content. That isn't what I want, but thanks for the answer.
I think I need to clarify what I am trying to do.
The combobox uses a ListField called prov_name and this is a lookup list of province and state names.
The KeyField is called prov_code and is a lookup list of province and state abbreviations.
So, if the province name is 'British Columbia', and I click on British Columbia, the edit box needs to contain 'BC'.
Similarly, if the state is California, 'CA' needs to appear in the edit box.
-
Problem solved.
One query to populate the combobox and one more to populate the edit box using the combobox caption. Painful compared to another Pascal offering.............