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

Records from multiple tables in List Box

Status
Not open for further replies.

Tommy408

Programmer
Apr 30, 2006
53
US
Is it possible to display records from multiple tables in one List Box? The tables have the same field but different values and different ID.
 
How are ya Tommy408 . . .

Have a look at [blue]Union[/blue] queries!

Calvin.gif
See Ya! . . . . . .
 
This would have to be set through VBA? Anyone know how I can set it without VBA? I've tried messing around with Query Builder, but got no good result.
 
All the Join properties in Query Builder are either one or the other not both.
 
Tommy408 . . .

Your prior two posts show you have'nt looked up [blue]Union Query[/blue] in access help! . . . Make it so! ;-)

Calvin.gif
See Ya! . . . . . .
 
Anyone?
I have a lot of fields and more fields will be added. It'd be nice to know how to pull records from both table from Query Builder view not SQL view.
 
Ok, I guess I have to use SQL View to use Union Query.

Thank you.
 
Tommy408 . . .

All you have to do is make a query (in design view) for each table. When your satisified with results, copy the SQL in SQL view and paste into the SQL View of the Union Query. Just remember to add the Keyword Union to all but the first SQL you paste and that each SQL needs to have proper field alignment,type.
Code:
[blue]Select txtField, numField, curField
From table1
Union Select txtField, numField, curField
From table2
Union Select txtField, numField, curField
From table3;[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top