how to go to a particular record using recordcount

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajvbprogramer
    New Member
    • Mar 2007
    • 2

    how to go to a particular record using recordcount

    here is my problem.

    i have two records. one containing 20 records and second containing 30 records.
    now i want the recordcount property to use and go to the 21 record.
    i m calculating the recordcount of both the record. now i m doing this
    Code:
     a =  rs.recordcount 
     b =  rs1.recordcount 
      
    for x = b+1 to  a 
    
      rs.move(x)
    but its not going to 21 record but it is going to 22 nd record.

    can anyone please help me wiith that . how i can go to the 21 record using recordcount .
    Last edited by Killer42; Apr 9 '07, 05:28 AM. Reason: Fixed [code] tags.
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Try this:

    [PHP]
    rs.MoveFirst
    rs.Move 21[/PHP]

    Always move to first before moving to any number. Otherwise it will be relative to current record.

    Example:
    If you are on record 5 and you say
    rs.move 21
    It will go to 21st record starting from 5 it will appear on 26.

    Good Luck.

    Comment

    • cmrhema
      Contributor
      • Jan 2007
      • 375

      #3
      Originally posted by iburyak
      Try this:

      [PHP]
      rs.MoveFirst
      rs.Move 21[/PHP]

      Always move to first before moving to any number. Otherwise it will be relative to current record.

      Example:
      If you are on record 5 and you say
      rs.move 21
      It will go to 21st record starting from 5 it will appear on 26.

      Good Luck.
      Thank you iburyak. I have a similiar problem. I will sort now.

      Comment

      Working...