PDA

Click to See Complete Forum and Search --> : DataBound Combo ListField


DrewDog_21
Jul 17th, 2000, 10:23 AM
this HAS to be possible, since it can be done in Access:

How can I display more than one field as the ListField in a DataBound Combo? I want to display the values of fields LAST_NAME and FIRST_NAME for each record.

Thanks

Andrew

Glenn
Jul 17th, 2000, 03:21 PM
Unfortunately MS in it's infinite wisdom has seen not to provide the same combo box to VB as it does for Access. Combox boxes in VB only support 1 field. The only way to get multiple fields into a VB combox box is to concatnate them together in the SQL string or in VB code.

This is a long standing complaint with the VB combo box. Many 3rd party vendors have been providing this type of control for a long time


:):)

DrewDog_21
Jul 17th, 2000, 05:32 PM
How would I do that in SQL string? What would be the syntax?

Glenn
Jul 18th, 2000, 08:33 AM
You can concatenate fields by using something like the following:

SELECT FirstName + LastName AS FullName FROM table

This will return a single column named FullName

This works for SQL Server, it should also work for Access.

:):)