Problem with recordset EOF

DocNice

Registered User.
Local time
Yesterday, 17:27
Joined
Oct 6, 2004
Messages
76
I have a recordset that says Recordcount is 7, but when I tell it to MoveLast, it goes to 6. If it's on 6 and I tell it to MoveNext, it goes into EOF and gives errors.

The code is too long to post here, but I did a search and saw some comments about problems with nested loops. This makes sense because it only gives the error when I call other loops and recordsets outside the function. But I don't know a way around that. I'm actually working on the same data in a few different recordsets, but I'm not sure why that would cause a problem if they're all separately defined (I also tried using the same recordset multiple times). And either way, when I say MoveLast, it seems that it should know that if there are 7 records, then it goes to the last one.

Any ideas?
 
I can't remember, but maybe Recordcount is 1-based & record number (in code) is 0-based?
 
It may be because you are using the EOF condition in Do .... Loop in a wrong way.
Try Do While ...... Loop, instead of Do ........ Loop Until
Can not say the actual problem without seeing the code.
 

Users who are viewing this thread

Back
Top Bottom