DAO Create recordset from recordset

M

mdaisl

Can someone tell me how to create a recordset from a recordset?
dim db as database
dim rs1 as recordset, rs2 as recordset

set db = currentdb
set rs1 = db.openrecordset("select x, y, z from t where x = 0")

now i want to create a subset of the above recordset???

set rs2 = db.openrecordset("select x, y, z from rs1 where y = 1")
 
M

Marshall Barton

mdaisl said:
Can someone tell me how to create a recordset from a recordset?
dim db as database
dim rs1 as recordset, rs2 as recordset

set db = currentdb
set rs1 = db.openrecordset("select x, y, z from t where x = 0")

now i want to create a subset of the above recordset???

set rs2 = db.openrecordset("select x, y, z from rs1 where y = 1")


rs1.Filter = "y = 1"
Set rs2 = rs1.OpenRecordset()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top