How to assign multiple colums to a listfield in datacombo control

I want two fields (code,descr) to be assigned to the listfield property for my datacombo control. Its easy to assign one field from the recodset but two dont seem to work.
LVL 5
mccainz2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nomulapConnect With a Mentor Commented:
Here is a work around.

You can write a query for example:

Select Code || '  ' || Desc as CodeDesc from table1. (Basically the select statement is combining the two
fields to one field, this syntax should work for Oracle, you might have to tweak it for other databases)

Then set the ListField property of the dbcombo to "CodeDesc" field of the resultset.
0
 
jrspanoCommented:
you can only assign 1 to show in the db combo.  you could buy 3rd party controls to do this.  true dbcombo is a good one.  you could also not use a data bound combo and concatinate the 2 fields together in a string and then add the string to the combo box.
0
 
mccainz2Author Commented:
just had to rewrite for t-sql. select x+y as z from source.
BTW: Most people get a little peeved when you propose answers as it locks the question. SOP here is always propose as a comment.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.