Advance to Next Record

Results 1 to 2 of 2

Thread: Advance to Next Record

  1. #1
    Join Date
    Dec 1969

    Default Advance to Next Record

    I use an SQL statement to find the record matching a 6 digit ID number. The record is found, and the recordset object then contains one record from the database. I would then like to use a &#039Next&#039 button feature to advance to the next record in the database. The database holds real estate listing records, and is sorted by price in a descending order. My primary key is a non-consecutive 6 digit number, and so far, I have not figured out a way to advance to the next record (RS.Movenext will not work if there is only one record in the recordset). Can anybody help?

  2. #2
    Join Date
    Dec 1969

    Default Next record in what order?

    What do you want that next record to be? The ID Number that is immediately greater than the current ID Number? The next lowest or highest price of a house? If I were you, I would go ahead and run a query obtaining all records you would possibly need, sorted in the order you need them. Then use a loop in your script to go through until you find the house that matches the ID the user has typed in. At that point you can use RS.Movenext, so you have all the flexiblity of moving around that you would need.

Posting Permissions

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