bizarre VBA compilation error

J

jfp

This has happened to me a few times (obviously, at random)

In Module A (typically a simple code module) i have a function X with an
arg declared as ByRef (and perhaps other arguments as well)
In Module B (typically a form module) i call X.

Everything compiles and works.
I save copies of A and B (via "File / Export File" from the VBA IDE).

Then, i make various changes to B. None of these affect the call to X.
I make NO changes to A. Sooner or later, when i compile, i get an error
in A at the function call to X, stating that there is a "ByRef argument
mismatch".

To fix this, i delete ALL the code from A and reload it (via "Insert /
File" from the VBA IDE) from the saved copy. Again, everything compiles
and works.

This is scary. Any comments ?
Access 2002 (10.2627.3311)
NO Service Packs installed.

P.S. This last time, the arg in question was a DAO.RecordSet. I do not
remember if it has been this way the other times, but it may well have
been.
 

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