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

Populating ListBox from 2 sources

Status
Not open for further replies.

DanKay1

Programmer
Jun 9, 2004
54
US
Is there a way i can populate ListBox with Values from One field in Table1 and at the same time populate One field from Table2?
 
as long as the tables have a key field that can be joined on you can use a query as the source of the ListBox with the two fields in it.

PaulF
 
The SQL view of your query for your list box would be something like this:
Code:
SELECT table1.Field1 FROM table1 AND table2.Field1 FROM table2

I'm not making any garantees, but like PaulF said, as long as their is some sort of link, it should be no problem.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Simply join in a query expression should do.

kjv1611 gives you part of it but to expand on it:

Code:
[b]SELECT[/b] table1.item1, table2.item3 [b]FROM[/b] table1, table2 [b]WHERE[/b] table1.keyfield1 = table2.keyfield1

This is known as a theta join btw.
 
This is known as a theta join btw
I don't think so.
For me a theta join is a join with not equi operator(s).
The most popular theta join is a less than self join used for ranking or running total.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi,
As long as DanKay1 needs to populate a listbox with one field from first table and one form the second, I believe a union query will do this.
Code:
SELECT Table1.Filed1 FROM Table1;
Union Select 
Table2.Field1 FROM Table2
regards

Zameer Abdulla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top