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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill 1 listbox, 1 column from two fields 1

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I have a listbox with 1 column. I am trying to fill it from two fields in a table to produce a distinct list? How can I do it if its possible. Thanks
 
Use the concatenation operator &

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV, however that puts the items side by side. I am trying to see if there is any way to avoid generating a common table and then filling the list. Might be the only way? Regards
 
You can use a union query
[tt]
fieldOne fieldTwo
------------------------
Car Dog
Bike Cat
Motor Cycle Dog
Motor Cycle Cat
Bike Dog
Dog Cat
Cat Dog
[/tt]

sql
Code:
Select fieldOne from tblOne UNION Select FieldTwo from tblOne;

output

[tt]
fieldOne
--------
Bike
Car
Cat
Dog
Motor Cycle
[/tt]
 
Many thanks. Thats an easier way I never thought of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top