Click to See Complete Forum and Search --> : Debugging Rs.MoveFirst and rs.movelast errors
Caro
Sep 28th, 2000, 05:11 AM
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??
VBOB
Sep 28th, 2000, 06:34 AM
What exactly are you trying to do ?
Is it something like ....
RS.MOVEFIRST
Do until RS.EOF
.....
.....
RS.MOVENEXT
LOOP
Caro
Sep 28th, 2000, 08:00 AM
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.
VBOB
Sep 28th, 2000, 09:38 AM
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
Caro
Sep 28th, 2000, 10:09 AM
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.
Cenobite
Sep 28th, 2000, 11:10 AM
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.
Caro
Sep 28th, 2000, 12:59 PM
No I'm not chamging anything, any suggestions welcome as it's driving me nuts - especially as it works 90% of the time!!!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.