R
RioDeSmoke via AccessMonster.com
I have some code that loops through a Recordset in order to select an X
amount of random records. When I select 10 records I get 10 -- 20 I get 20
and so on. But, when I select 400, I get 369 at times and 381 at others.
The difference gets greater the more records I select. I believe what is
happening is that the random numbers being generated are being duplicated and
it can't select the record more than once. Here is my code within my loop:
MyRS.MoveLast
NumOfRecords = MyRS.RecordCount
Randomize
SpecificRecord = Int((NumOfRecords * Rnd) + 1)
Has anyone ever seen this? Please help if you can this is driving me crazy!
amount of random records. When I select 10 records I get 10 -- 20 I get 20
and so on. But, when I select 400, I get 369 at times and 381 at others.
The difference gets greater the more records I select. I believe what is
happening is that the random numbers being generated are being duplicated and
it can't select the record more than once. Here is my code within my loop:
MyRS.MoveLast
NumOfRecords = MyRS.RecordCount
Randomize
SpecificRecord = Int((NumOfRecords * Rnd) + 1)
Has anyone ever seen this? Please help if you can this is driving me crazy!