VBA query within query

  • Thread starter Thread starter Adriana
  • Start date Start date
A

Adriana

Hi,

I want to create a select query through VBA. However,
this query includes a query that was also created through
VBA. I don't know how to place this query within my new
one because it doesn't really exist. I can't use "SELECT
qr1.accountNum FROM..." when qr1 only exists through a
recordset.

Thanks for ur help,

Adriana
 
Hi,



Dim rst2 As DAO.Recordset
rst1.Filter="..." ' if applicable
Set rst2=rst1.OpenRecordset()

where rst2 would got only the records of rst1 WHERE the filter criteria is
satisfied. I assume rst1 is also a DAO recordset.

Otherwise, you cannot use a recordset (a VBA beast) in an SQL statement.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top