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

Union qry with DB objects?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Hello all! I have a form that needs to gather information from at least 3 different tables. Do I need to have a qry and dataset for each table or will the DB Edit, Radio Buttons, Listbox, etc. work if I use one query with a UNION clause?

Thanks for any insight!
Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
You can use UNION, but you fields in the table must of the same type. And UNION will only select different records i mean if you have values 1, 2 in table A and values 2, 3 in table B then after UNION you'll get 1,2,3. If you want all records, then use UNION ALL.
Hope that makes sense.

--- markus
 
You can make a composite query out of different tables with joins, but you will not be able to edit the data, it will return a read-only dataset. Steven van Els
SAvanEls@cq-link.sr
 
To get additional information from other tables you can also use fkLookup fields. Done right you can have a straight forward select in the main query which would allow editing.

lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top