Web Development
10 replies
by hmertens
If I understand you correctly this is the proper behavior for the combo-box; it is bound to a single field and can only hold a single value. I presume your select query is of the form:
SELECT fldA, fldB FROM tblX
Two thoughts: if you want to have both fields from the SELECT to be assigned to the bound field then use this query:
SELECT fldA+" "+fldB FROM tblX
or:
SELECT LEFT(fldA+SPACE(5),5) + _
LEFT(fldB+SPACE(5),5) FROM tblX
(presuming in the latter that values in fldA/B are 5-chars or less).
Alternately if you just need the second value from the query to be displayed then add an update event to this combobox and update the value in a accompanying text box beside it...
by bob sellman
Combining the columns, as mentioned in the answer above, is the only way to have both fields displayed.
This works best if your source query table has an ID or code field that is the data stored in your data table. So the column in the data table that is the data source for the combo box would be the one containing the ID. In the drop down box you probably would not display the ID, or, if you do, then you'll have to include it as part of the concatenated columns used for the value displayed in the combo box. I normally hide the IDs except in the situations where they are meaningful outside of the application, such as employee account numbers that are used throughout a company.
by donq
by whyong
just want to share with you what i normally "do" with the combo box.
when i want to display more than 1 field
i will create another text box, and assign the field 2 value to the text box by writing some code in the combobox onclick event :
textbox = combobox.column1
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending