Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


MoveLast doesn't appear to be working...

MoveLast doesn't appear to be working...

I have the following code and I am stepping through it and monitoring a watch variable for rsx.EOF
but immediately after it executes the rsx.MoveLast line in the code, the watch variable stays at
rsx.EOF False

I would expect it to be True after executing this. Any suggestions why it isn't?


CODE -->

strSql = "Select * from SameOrd_tbl order by License_PartNO"
   Set rs = CurrentDb.OpenRecordset(strSql, dbOpenDynaset)
   strSql = "Select * from PC_Lic_Line_tbl order by License"
   Set rsx = CurrentDb.OpenRecordset(strSql, dbOpenDynaset)
   If rs.RecordCount > 0 Then      ' if this is an empty table then don't bother...
      rs.MoveFirst                    ' Get first rsx record
      If rsx.RecordCount > 0 Then      ' if this is an empty table then don't bother...
         Do While Not rs.EOF
            rsx.MoveFirst                     ' Get first rs record
            Do While Not rsx.EOF
               If rs!License_PartNO = rsx!License Then
                     rs!SystemType = rsx!SysType
               End If
      End If
   End If

This code was working fine for some time and all of a sudden it started to get hung up
because the Movelast stopped setting the table to EOF.

I closed the database for a few minutes and then no problems it worked fine but
after half a dozen times with no reoccurring incidents it reared its ugly head again.

any ideas how to trouble shoot this problem?


RE: MoveLast doesn't appear to be working...

rsx.MoveLast points to the last record in your rsx and that's why rsx.EOF False.

If you would do:
-> that would point you to EOF (rsx.EOF = True)

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: MoveLast doesn't appear to be working...

Thank you Andy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close