To get random numbers you MUST use the Randomize statement. As for the Id being greater than the number of records in the array, have you remembered that the array starts at 0. So if your table has 50 records, the array elements will be numbered 0-49. <BR><BR>I think that this will work for you <BR>Allkeys = Rs.GetRows <BR>recCount=Ubound(AllKeys,2) + 1 <BR>Randomize <BR>choose = Int(Rnd * recCount) <BR><BR>hi, for the above it works. BUT i have a paging record system. so its like page 1, 2, 3, 4. The first time i went into the random function. A certain number of records is being randomized already and is shown in pages 1, 2, 3, 4. NOW, the first time i went to page 1. I noted the records. Then i went to page 2. I found out that page 1 records has been changed when i go to page 2 then back to page 1. any counter solution