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

Listbox with 1 row from multiple table 1

Status
Not open for further replies.

Xenocide

Programmer
Jan 20, 2005
76
CA
I'm trying to create a listbox from a select that pick up information from 2 different table in the same database

As it should do.. the listbox put those 2 information in 2 row. Because of that when the user select one the other is selected at the same time but that's not what I want.

I want 1 row. I want the 2 informations to each have their own line so the use will be be able to select one or another.

Here's my select if that can help :

SELECT [Table850].[IdEngagementA], [Table807].[IdEngagementA], [Table850].[Description], [Table807].[Description]
FROM Table850, Table807
WHERE ((([Table850].[IdEngagementA])="00-000000-00"));
 
Forgot to ask if it was possible in just 1 query
 
How are ya Xenocide . . . . .

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

Calvin.gif
See Ya! . . . . . .
 
Thanks Aceman

There's still a problem.. it just show the information from the first select...

here's my new query

SELECT [Table850].[IdEngagementA], [Table850].[Description]
FROM Table850
WHERE ((([Table850].[IdEngagementA])="00-000000-00"))

UNION ALL

SELECT [Table807].[IdEngagementA], [Table807].[Description]
FROM Table807
WHERE ((([Table807].[IdEngagementA])="00-000000-00"));


This should now be moved to the Query forum :p
 
Xenocide . . . . .

Try this:
Code:
[blue]SELECT [Table850].[IdEngagementA],  [Table850].[Description]
FROM Table850
WHERE ((([Table850].[IdEngagementA])="00-000000-00"));
UNION
SELECT [Table807].[IdEngagementA], [Table807].[Description]
FROM Table807
WHERE  ((([Table807].[IdEngagementA])="00-000000-00"));[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks for the help Aceman .. I tried mostly everything (also did that post in the query forum) and the problem come from my database but until now I can't seem to find what it is.
 
Xenocide . . . . .

Do the queries work individually?

Calvin.gif
See Ya! . . . . . .
 
It's ok it was a problem due to the form that was creating the entry in the table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top