Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Unanswered: In Access 97, how do I access the ith record of a recordset

    I'm trying to access a particular field of an arbitrary record from a recordset. How do I do this? Is there an array access style mechanism? i.e.

    myrecordset ("fieldname") (i)

    Any help would be greatly appreciated. I know this works in Access XP, but not 2000 or 97.

  2. #2
    Join Date
    Dec 2002
    Posts
    60
    Try a for/next loop similar to:

    (say you want the 5th record of recordset 'myrecordset')

    intRecord=5

    myrecordset.movefirst

    For intI=1 to intRecord
    myrecordset.movenext
    Next intI

  3. #3
    Join Date
    Feb 2003
    Posts
    3

    So there's no way of directly accessing the ith record?

    So does that mean that there is no way of directly accessing the ith record in Access 97 or 2000?
    Justin

    PS: Sorry about the double post, pressed back and refresh by accident.

  4. #4
    Join Date
    Jan 2003
    Posts
    46
    Perhaps you might try the Recordset.AbsolutePosition property as in:

    Me.recordset.AbsolutePosition = 5

    Subtitute a variable for the 5 and you may get where you need to.

    Cheers,
    zambezibill

Posting Permissions

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