Resolution – VBA Error 49 – Bad DLL Calling Convention

So everything in this particular database was working for
a client of mine, until just last night I get notified that
he can’t open the database because of some error.

I was able to view his screen using T.V. and after clicking on
a command button, I would get the following error:

Runtime Error 49 - Bad DLL calling convention

“Error 49 – Bad DLL Calling Convention”

Now, I have been working with Access for over 15 years, so I’m no novice, but I have
never seen this error before. Normally, when I see an error, I can tell myself, “Oh
I’ve seen that before, and last time I did this…”

This error is not a real common one for me. So I started hunting for a solution.

I noticed when I clicked “debug” that the code would break on my “IsLoaded” function.

So I “googled” for “Isloaded” and “Error 49” together.

…and I came across this link “”

…which deals with Excel VBA.

“OK, maybe it will help”, I thought. “Makes sense”

So I added the following code above the code in the module where my “IsLoaded” function is located:

Private Something
     member = 1
End Enum

So altogether it was:

Private Something
     member = 1
End Enum

Public Function IsLoaded(this_form)
     '...code for function
End Function

…That’s all, AND IT WORKED!


Apparently it was some compilation error in the C libraries and this straightened
things out.

Maybe you have had a similar experience. If you have another solution, feel free to
share it.

Offsite Related Information:

“Go Fund Me” Page

($5 suggested amount)

(…10% of your gift amount will go to charity)

Free! Subscribe To Our YouTube Channel!

Free MS Access VBA Programming Course

Tags: , , ,