ado Recordset filtering
Posted on 2011-02-10
I have using a query to open a recordset where I have three fields namely Amount, TransNo, TransDate. When I open the recordset in the win form I will have to loop through this recordset and compare each of the amount against the value user entered.
i.e. If RS.Fileds("Amount") <= txtAmount Then.....
How do I loop through this in ADO Recordset as this can be done only in VB script? Moreover, there might be occasion where multiple records might meet the criteria in that case I need to requery the recordset and select the vary latest one using the transdate field as filtering criteria.
Amount TransDate transNo
29 12/01/2011 RT2568
20 05/01/2011 QR2148
45 01/02/2011 RY2531
Say, If I use Criteria If Amount <= 50 Then all three will be qulifying this criteria so I willl select the first one because that is the latest one in this recordset.
Please someone help me?