Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-18-2019, 02:36 AM   #1
TimTDP
Newly Registered User
 
Join Date: Oct 2008
Posts: 202
Thanks: 37
Thanked 1 Time in 1 Post
TimTDP is on a distinguished road
Filter Recordsets

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

TimTDP is offline   Reply With Quote
Old 01-18-2019, 02:58 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,893
Thanks: 40
Thanked 3,532 Times in 3,415 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Filter Recordsets

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
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with recordsets Design by Sue Modules & VBA 6 12-18-2014 09:53 AM
VBA DAO with two recordsets prometro Modules & VBA 4 04-21-2014 01:25 AM
Recordsets GBalcom Modules & VBA 3 02-20-2013 10:54 AM
Help With VBA - DAO Recordsets mzanzilla Modules & VBA 10 11-15-2011 07:22 PM
Need help with recordsets hbrems Modules & VBA 3 07-26-2007 06:00 AM




All times are GMT -8. The time now is 06:27 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World