Here's my problem. After applying the filter on a recordset, I cannot get a random record from that result set. Like my code outlines, the RecordCount changes.
I cannot specify search criteria in the SQL query, because I need to manipulate the recordset about 4 times. I figured that it would be a lot better to have one object holding about 100 records than 4 objects holding around 25 records each. This recordset is disconnected, so the performance hit isn't as bad as you would think it would be.
BTW - I know that I can loop while not RS.EOF to determine the count, but there has to be a much less expensive solution...
thanks in advance for your help.
leo
I cannot specify search criteria in the SQL query, because I need to manipulate the recordset about 4 times. I figured that it would be a lot better to have one object holding about 100 records than 4 objects holding around 25 records each. This recordset is disconnected, so the performance hit isn't as bad as you would think it would be.
Code:
RS.RecordCount 'this gives a value of 5
RS.Delete
RS.RecordCount 'this gives a value of 4
RS.Filter = "field1 <= 2" 'limits the recordset to 2 records
RS.RecordCount 'this gives a value > 2
Randomize timer
t = int(rnd * RS.RecordCount) ' t can be > 2
RS.Move t 'Error! Past EOF!!
BTW - I know that I can loop while not RS.EOF to determine the count, but there has to be a much less expensive solution...
thanks in advance for your help.
leo