Hi, I work with MS access to manage a database that currently has 4017 records. I made a vba program that allows users input new record manually (71 fields excluding the autonumber). Today i added a new field, and b4 i even try to update the vba code to work with that new field, the recordset object is unable to find records after record number 4014, even though when using .movenext (until eof) method i was able to count to 4017 but when using .movelast method it moves to record 4014 and when trying to access records pass that, it produce run time error 3021(no current record) and i can still use .addnew to add new record to 4018 and so on, but those record cannot be accessed too. I find it very weird that .movenext until eof produce different record than .movelast and wondering is there any source to this bug.
Also, if i delete the last few records, such as 4017, 4016, 4015, and 4014, then the .movelast will give me the 4013th record, but its still not able to access any new record thats added into the database past that record
Thanks for the replay, Lyreceus. I somehow solved the problem, i had an other field with memo datatype , and all i did was deleting that field and recreating the same field and copied the data back in there(even though that field worked just fine before, but i found out the .movelast started to go wrong when i add value(100 chars or so) to a specific one of the memo cell, otherwise nothing happens), and the vba program started to work again. I am almost certain this is a ms office 2007 bug, have encountered a couple in the past, but none as this weird.
Related posts:








1 response so far ↓
1 Lyreceus // Jun 17, 2008
That does sound weird. I'm not sure, but here are some thoughts on it:
It sounds like you have reached some kind of limit of memory or recordset size. I think the maximum number of fields in a recordset is 255 and the max length of characters in a SQL statement is 64K - but it does not seem obvious that you have reached those limits from what you describe.
You might try using a recordset with a different cursor type. MoveLast can only be used on a recordset that supports bookmarks or backward cursor movement, else it causes an error.
Make sure you are using the Update method on the recordset when adding new records.
If you remove the new field that seemed to cause this problem, does the code then work correctly again?
That's all I can think of right now.
—————————————–
EDIT:
vipt2006, I'm glad you got it working and found some clues about what is going on. I'll remember that in case I run into the same problem.
Good luck!
.
Leave a Comment