Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Control Source to handle 2 Row Source for ListBox 1

Status
Not open for further replies.

stlrain95

Programmer
Sep 21, 2001
224
US
I have a list box that displays 2 columns from a SQL row source.

Sample: SELECT CELL.Cell, CELL.Equipment FROM CELL GROUP BY CELL.Cell, CELL.Equipment;

When I select from the list box....I need both fields to display in the results box.

How would I go about doing this??

Thank you,
 
How are ya stlrain95 . . . . .

Be more specific!

Calvin.gif
See Ya! . . . . . .
 
Take a look at the ListBox.Column property and at the & concatenation operator.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Haaaaaaaay [blue]PHV! . . . . .[/blue]

Before its too late:

Highest [purple]Respects![/purple] . . . . . [blue]Honor![/blue] . . . . .

and [green]Happy New Year! . . . . .[/green]

Calvin.gif
See Ya! . . . . . .
 
Alright, in the form I have a list box displaying 2 columns of information.

What I need is when I make a selection, I need both to show in the field.

Example:
Cell.Cell & Cell.Equipment show in drop down
But only Cell.Cell displays when selected.
 
OK stlrain95 . . . . .

It appears your talking a combobox from your last post (not a listbox), and specifically [purple]what shows in the TextBox portion[/purple] of the combobox . . .

Be aware, the textbox portion can only show a single column. In fact, its always the [blue]first non-zero width[/blue] in the [blue]Column Widths[/blue] property. So what you need to do is add a custom field with the concatenation to the [blue]RowSource[/blue]:
Code:
[blue]Sample:  SELECT [purple][b][Cell] & " " & [Equipment] as DspCell[/b][/purple], Cell, Equipment, FROM CELL GROUP BY CELL.Cell, CELL.Equipment;[/blue]
Increase the [purple]Column Count[/purple] property to 3 and make sure the new field (dspCell) is the [blue]1st non-zero width[/blue] in the [blue]Column Widths/b][/blue] property.


Calvin.gif
See Ya! . . . . . .
 
Awsome....working greatness

You get a star!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top