DAO Clone and filter question

T

Tim Ricard

Good afternoon,

I am trying to clone a recordset that has a filter and sort property
(DAO here, not ADO):

rs.Filter = "Quantity <=" & lngQuantity
rs.Sort = "Cost DESC, Primary"

I want the filtered values from this recordset, but I also want the
bookmarks. It appears as though:
set rs2 = rs.clone

will only give me the clone of the original recordset without the
filter and sort arguments but if I simply:
set rs = rs.OpenRecordSet()

then I have no way of sharing the bookmarks... or do I?

Is there a way to share bookmarks if I know that rs2 is a subset of rs
through code?

Thanks for the help

Tim
 
K

Ken Snell \(MVP\)

To open a filtered recordset, you must use the OpenRecordset method of the
recordset that has been filtered.

set rsF = rs.OpenRecordSet()

rsF will not have the same Bookmark values as rs. Why do you need the
Bookmark values? Can you not just do a FindFirst in rsF recordset to move to
the desired record?
 

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