move record in recordset

Results 1 to 2 of 2

Thread: move record in recordset

  1. #1
    Join Date
    Dec 1969

    Default move record in recordset

    Hi,<BR><BR>I&#039;ve a recordset named rsTest, and I want to move the cursor to an random generated position inside the recordset repeatly.<BR><BR>However, how can I check if the position of cursor is already the random generated number before moving the cursor?<BR><BR>Codes as follow:<BR><BR>iMaxCount = rsTest.RecordCount<BR>Randomize Timer<BR>rndNumber = Int(RND * iMaxCount)<BR>rsTest.Move rndNumber<BR><BR>Thanks.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: move record in recordset

    &#060;%<BR>iMaxCount = rsTest.RecordCount<BR>Randomize Timer<BR>rndNumber = Int(RND * iMaxCount)<BR><BR>If rsTest.AbsolutePosition &#060;&#062; rndNumber Then<BR> rsTest.Move rndNumber<BR>End If<BR>%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts