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

Populate a ListView with two queries 1

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
I am using Access 2003 and I am populating a ListView with the following query which is working just fine.

Dim rs As DAO.Recordset: Dim db As Database: Dim lstitem As ListItem: Set db = CurrentDb()
strSQL = "Select * From ABS_Daily where (Machine > 0) and (Priority < 5) order by PDate desc, Priority":Set rs = db.OpenRecordset(strSQL)

I would now like to add the records from the following query (same db, different table) to the same ListView and I am not quite sure how to construct the query.

strSQL = "Select * From Flex_Winder where (Machine = 0) and (Priority < 5) order by PDate desc, Priority"

Thank you for any assistance.
 
strSQL = "Select * From ABS_Daily where (Machine > 0) and (Priority < 5) order by PDate desc, Priority"

strSQL = SqlStr & " Union Select * From Flex_Winder where (Machine = 0) and (Priority < 5) order by PDate desc, Priority"

Set rs = db.OpenRecordset(strSQL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top