Results 1 to 7 of 7

Thread: rst.EOF

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    How would I make an if statement for if it's the last record in the recordset to do something?

    Thanks.

    I tried (if rst.EOF) but that didn't work.
    If you think education is expensive, try ignorance.

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    108
    Why don't you MoveLast and do something prior or after you had finished with your other records?

    Regards.

    KT

  3. #3
    New Member
    Join Date
    Nov 2000
    Posts
    3
    You are geaded in the right direction... try:

    If rst.eof=true then
    ...
    End If

    Mordechai Boehm
    LaserStreak Consulting
    www.LaserStreak.com

  4. #4
    Junior Member
    Join Date
    Nov 2000
    Posts
    20

    Reply


    Navigate through the recordsets using:



    while not rs.eof
    ....
    ....
    do something
    ....

    wend

    To work upon the last record only use

    rs.MoveLast

    Happy Programming!

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    Thank you. I will try those suggestions.
    If you think education is expensive, try ignorance.

  6. #6
    Fanatic Member Gaffer's Avatar
    Join Date
    Nov 2000
    Location
    London
    Posts
    828
    I believe that if you Movelast, then use a For...Next loop based on the recordcount, you'll get better performance (specially if you have a lot of records in the recordset)...

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    What I'm building is a shopping cart. Each product is being pulled from a database and after writing each table I do an rst.MoveNext. The only problem is while pulling it from a database using the relationships I have setup it needs to do something different on the last one. The records will probably be less than 20 or 30 (at most) so rst.EOF = True should work I think.

    If anyone has any suggestions please let me know.
    If you think education is expensive, try ignorance.

Posting Permissions

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



Click Here to Expand Forum to Full Width