Unexplained "Bad Record Length" error / bug?

D

Dave

As an experienced VB programmer, I understand the normal causes of the
Bad Record Length error. I am stumped on this though and believe it to
be some kind of bug in VBA...

I have several user-defined data types which I use to Put/Get data to
and from random-access files. Occasionally I get the "Bad Record
Length" run-time error. There is no apparent reason for this error
occuring, it is intermittent, and can be resolved by the following
process:

- comment-out an element within the data type
- attempt to run a procedure that includes a reference to this element
(this obviously causes a compile-time error "Method or data member not
found")
- end code execution
- reinstate declaration of the element

This process, in effect, forces VBA to recompile / rebuild the data
type, and everything runs fine again.

Anyone have an explanation?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top