stormin_norm
Registered User.
- Local time
- Today, 01:14
- Joined
- Apr 23, 2003
- Messages
- 213
I searched all over for a good example of filtering a recordset then refiltering and want the most efficient way of handling the following:
I have query returning all people as
level name
10 smith
20 jones
20 jackson
40 simpson
so my db.OpenRecordSet ("qryAllPeople") will give me everyone. And then I simply want to apply a filter for each level as:
for lvl 10 to 90 step 10
rs.filter "[level]=" & lvl
do until rs.EOF
yadayada
rs.MoveNext
Loop
Right now, I constantly close and re-open the querydef in the for loop:
for lvl 10 to 90 step 10
set rs = db.OpenRecordSet ("Select * from qryAllPeople where level = "&lvl)
do until rs.EOF
yadayada
rs.MoveNext
rs.close
Loop
Would a bookmark be better or clone? I feel opening and closing the recordset is inefficient.
thanks!!
I have query returning all people as
level name
10 smith
20 jones
20 jackson
40 simpson
so my db.OpenRecordSet ("qryAllPeople") will give me everyone. And then I simply want to apply a filter for each level as:
for lvl 10 to 90 step 10
rs.filter "[level]=" & lvl
do until rs.EOF
yadayada
rs.MoveNext
Loop
Right now, I constantly close and re-open the querydef in the for loop:
for lvl 10 to 90 step 10
set rs = db.OpenRecordSet ("Select * from qryAllPeople where level = "&lvl)
do until rs.EOF
yadayada
rs.MoveNext
rs.close
Loop
Would a bookmark be better or clone? I feel opening and closing the recordset is inefficient.
thanks!!