I get a bad record number error when I use this:
Put #filehandle, (i * 100) + x, buf(x)
when filehandle is an integer, that I opened via this.
filehandle = FreeFile
Open (App.Path & "\" & BufferFileRootName & "A") For Binary As filehandle
How could I fix this and what am I doing wrong?
You should check out the values of
iandxthat you are using. A bad record number onputusually indicates that the record number is less than or equal to zero.If you print out the values of
iandx(as well as the result of that calculation), it should hopefully tell you what’s wrong.Keep in mind that record numbers are 1-based so, if both your
iandxvariables are zero, that would cause this problem.