Please help me.
I am writing a stock control program.
I use several random access files to store data.
All but one of the random access files always loads perfectly.
One of them gives a randomly occurring "bad record length - error 59" error.
It usually occurs when changes are made to a completely separate part of the VBA Project or when I restart Excel and reload the project.

If I save the workbook (In the error state) and then reopen it - The error always persists.

If I take a random piece of code and cut / paste the error disappears and the file loads normally.
The identical code suddenly becomes error free!
I can then save the workbook and reopen and it continues to work normally - for a few hours - until the error reappears.

There are no changes made to the data file.
I use Len(Record) to get the record length, LOF(n) to get the file length and LOF(n) / Len(Record) to get the number of entries.
When the error occurs I have Len(Record) = 283, LOF(n) = 88862 and number of entries = 314.
As you can see : 283 x 314 = 88862

Please,

IanBrasil