"Filtering" a recordset

casey

Registered User.
Local time
Today, 21:46
Joined
Dec 5, 2000
Messages
448
Hello all,

"Filtering" a recordset

I have a DAO.recordset that gives me sales for a range of dates pulled from SQL Server. Once I've connected to the Recordset, I would like to apply a "filter" to the same Dataset several times to find a particular salesperson, crunch some numbers, then remove the "filter" and apply another "filter" and reuse the recordset over and over in this way. I don't know if I need a parameter query or if there's a way to filter a recordset once a connection has been established? Can someone give me suggestion as to how I might get this to work?

Thanks a whole lot!
 
You can set the 'filter' on a recordset like this:
Set rst3 = db.OpenRecordset("SELECT " & yoursalespersonfield & " from yourdb where parameters")
Then do the calcs you want and loop back to this with your new salespersonfield.
k
 
Thanks.

Yes, setting a filter works.

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom