Filter Recordsets (1 Viewer)

TimTDP

Registered User.
Local time
Today, 12:37
Joined
Oct 24, 2008
Messages
210
I have a dao.recordset called "rstPurchaseOrder" which contains SupplierId, ProductId & CurrencyId which I want to use to create purchase orders.

I need create a purchase orders for each supplier and currency. Each purchase order may only have one currency.

How do I loop & filter the recordset "rstPurchaseOrder" to achieve this?

Thanks in advance
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2013
Messages
16,553
to loop

Code:
rst.movefirst
while not rst.eof
    'do something here
    rst.movenext
wend

to filter

Code:
rst.filter="Item=1234"
set rst=rst.openrecordset

however rst cannot be recovered back to the original set with this method, so assign to another recordset e.g.

Code:
rst.filter="Item=1234"
set rst2=rst.openrecordset
 

Users who are viewing this thread

Top Bottom