Results 1 to 7 of 7

Thread: Debugging Rs.MoveFirst and rs.movelast errors

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203
    I do a Rs.Movelast if I'm at EOF and rs.MoveFirst at BOF. Sometimes this works and sometimes i get an error saying the action was cancelled by an associated object. I can see my recordcount and there are records present (usually about 2 or 3 in each recordset). What else can I look at to get a clue why this sometimes works and sometimes not??

  2. #2

    Unhappy Question ???

    What exactly are you trying to do ?

    Is it something like ....

    RS.MOVEFIRST

    Do until RS.EOF
    .....
    .....
    RS.MOVENEXT
    LOOP

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203
    I have next and previous buttons and if previous is hit whilst BOF I need to MoveFirst and if next is hit at EOF I ned to MoveLast - in some cases this works and others it doesn't.

  4. #4

    Wink

    In that case why not check the state before doing the operation.

    ie. Check for EOF/BOF then MoveLast/MoveFirst if not in that state.

    Bob

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203
    My code is
    On previous record button:

    If Rs.BOF Then
    Rs.MoveFirst
    End If

    This works in some cases for some recordsets - on others I get 'this action was cancelled by an associated object' run-time error 3426.

    What I'm not sure of is how to check what is going on. The recordset is at Bof and BOf action is MoveFirst.

  6. #6
    Lively Member
    Join Date
    Aug 2000
    Location
    Bristol, UK
    Posts
    86
    Are you changing the values of the fields before doing the move? I have seen a similar problem where data was entered which was longer than the field would allow. It came up with the same error. I suspect it is related to this.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203
    No I'm not chamging anything, any suggestions welcome as it's driving me nuts - especially as it works 90% of the time!!!

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